Mono Class Library: System.Threading.Interlocked Overview | MembersSystem.Threading.Interlocked.Increment Method |
Increments the specified variable and stores the result as an atomic operation. [Edit]
|
A long containing the incremented value. [Edit]
This method handles an overflow condition by wrapping: if location = long.MaxValue , location + 1 = long.MinValue . No exception is thrown.
The 64-bit versions of Interlocked.Increment(Int32@) and Interlocked.Decrement(Int32@) are truly atomic only on systems where a IntPtr is 64-bits long. On other systems, these methods are atomic with respect to each other, but not with respect to other means of accessing the data.
[Edit]
Namespace: System.Threading
Assembly: mscorlib (in mscorlib.dll)
Assembly Versions: 1.0.5000.0, 2.0.0.0