private static readonly object staticMutationLock = new object(); private static void WriterThreadEntry() { for (int i = 0; i < INCREMENT_PER_THREAD; ++i) { lock (staticMutationLock) { sharedState++; } } }