Interlocked.CompareExchange with Volatile.Write like this?Interlocked.CompareExchange synchronizes-with Volatile.Write to create a happens-before relationship.Interlocked.CompareExchange returns 0, previous memory operations in /* Do some work here... */ should be also visible to the current thread.