Mono Class Library: System.Threading.Interlocked Overview | Members

System.Threading.Interlocked.Increment Method

Increments the specified variable and stores the result as an atomic operation. [Edit]

[System.Runtime.ConstrainedExecution.ReliabilityContract(System.Runtime.ConstrainedExecution.Consistency.WillNotCorruptState, System.Runtime.ConstrainedExecution.Cer.Success)]
public static int Increment (ref int location)

Parameters

location
A int containing the variable whose value is to be incremented. [Edit]

Returns

A int containing the incremented value. [Edit]

Remarks

This method handles an overflow condition by wrapping: if location = int.MaxValue , location + 1 = int.MinValue . No exception is thrown. [Edit]

Requirements

Namespace: System.Threading
Assembly: mscorlib (in mscorlib.dll)
Assembly Versions: 1.0.5000.0, 2.0.0.0