I think I finally found a valid use of a ThreadVar variable but since this is going to be my first attempt to use them I have 2 basic questions.
1) How is a ThreadVar initialized? I plan to use a numeric variable either cardinal or QWord, I need it to be initialized to 0 on all threads accessing it.
2) Can I have threadVar object fields? something along the line of
type
TMyAwesomelyDumClass
Private
ThreadVar
FMyPerThreadVariable:DWord;
.
.
.
.
function MyPerThreadVar : DWord Read FMyPerThreadVariable write FMyPerThreadVariable; // this can be anything really its here to show some kind of access.
end;
Keep in mind, I know not what I'm talking about.