ok, its a little more complicated than the question.
class A
{
static int needsToBeThreadSafe = 0;
public static void M1()
{
needsToBeThreadSa
What you might be trying to ask about is the [ThreadStatic] attribute. If you want each thread that uses the class A
to have its own separate value of needsToBeThreadSafe
then you just need to decorate that field with the [ThreadStatic] attribute.
For more info refer to the MSDN documentation for ThreadStaticAttribute.