ok, its a little more complicated than the question.
class A { static int needsToBeThreadSafe = 0; public static void M1() { needsToBeThreadSa
class A { static int needsToBeThreadSafe = 0; static object statObjLocker = new object(); public static void M1() { lock(statObjLocker) { needsToBeThreadSafe = RandomNumber(); } } public static void M2() { lock(statObjLocker) { print(needsToBeThreadSafe); } } }