Provides atomic operations for variables that are shared by multiple threads.
Assembly: mscorlib (in mscorlib.dll)
public static class Interlocked
The methods of this class help protect against errors that can occur when the scheduler switches contexts while a thread is updating a variable that can be accessed by other threads. All method in this class are atomic; they cannot be interrupted until they complete.
Available in the .NET Micro Framework versions 2.0, 2.5, 3.0, 4.0, 4.1, and 4.2.