Interlocked Class

Provides atomic operations for variables that are shared by multiple threads.

Namespace: System.Threading
Assembly: mscorlib (in mscorlib.dll)

Syntax

public static class Interlocked

Remarks

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.

Version Information

Available in the .NET Micro Framework versions 2.0, 2.5, 3.0, 4.0, 4.1, and 4.2.

See Also

Reference

Interlocked Members
System.Threading Namespace