Decrements the specified variable and stores the result as an atomic operation.
- location
- A long containing the variable whose value is to be decremented.
A long containing the decremented value.
This method handles an overflow condition by wrapping: if location = long.MinValue , location - 1 = long.MaxValue . 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.
Namespace: System.Threading
Assembly: mscorlib (in mscorlib.dll)
Assembly Versions: 1.0.5000.0, 2.0.0.0