InterlockedExchangeSubtract function
Performs an atomic subtraction of two values.
Syntax
unsigned long WINAPI InterlockedExchangeSubtract( _Inout_ unsigned long volatile *Addend, _In_ unsigned long Value );
Parameters
- Addend [in, out]
-
A pointer to a variable. The value of this variable is replaced with the result of the operation.
- Value [in]
-
The value to be subtracted from the variable pointed to by the Addend parameter.
Return value
The function returns the initial value of the Addend parameter.
Remarks
This function generates a full memory barrier (or fence) to ensure that memory operations are completed in order.
Requirements
|
Minimum supported client |
Windows 7 [desktop apps | Windows Store apps] |
|---|---|
|
Minimum supported server |
Windows Server 2008 R2 [desktop apps | Windows Store apps] |
|
Header |
|
See also
- Interlocked Variable Access
- InterlockedCompareExchange
- InterlockedExchange
- InterlockedExchangePointer
- InterlockedExchangeAdd
- Synchronization Functions