InterlockedExchangeSubtract function

Performs an atomic subtraction of two values.

Syntax

unsigned InterlockedExchangeSubtract(
  unsigned volatile *Addend,
  unsigned          Value
);

Parameters

Addend

A pointer to a variable. The value of this variable is replaced with the result of the operation.

Value

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 | UWP apps]
Minimum supported server Windows Server 2008 R2 [desktop apps | UWP apps]
Target Platform Windows
Header winbase.h (include Windows.h)

See Also

Interlocked Variable Access

InterlockedCompareExchange

InterlockedExchange

InterlockedExchangeAdd

InterlockedExchangePointer

Synchronization Functions