Windows apps
Collapse the table of content
Expand the table of content
Information
The topic you requested is included in another documentation set. For convenience, it's displayed below. Choose Switch to see the topic in its original location.

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

WinBase.h (include Windows.h)

See also

Interlocked Variable Access
InterlockedCompareExchange
InterlockedExchange
InterlockedExchangePointer
InterlockedExchangeAdd
Synchronization Functions

 

 

Show:
© 2017 Microsoft