A
alexey_r
I need to set the value of a ThreadStatic field before starting the
thread. According to MSDN, setting the value normally won't work,
because this is done only once. Neither will a static constructor.
Checking for null every time the field is accessed is too slow. The
only idea I have is to use a second, bool, ThreadStatic field to tell
me if the first field has been initialized. Is there a better way?
thread. According to MSDN, setting the value normally won't work,
because this is done only once. Neither will a static constructor.
Checking for null every time the field is accessed is too slow. The
only idea I have is to use a second, bool, ThreadStatic field to tell
me if the first field has been initialized. Is there a better way?