InterlockedExchangeSubtract

InterlockedExchangeSubtract performs an atomic subtraction of two values.

Syntax

unsigned long InterlockedExchangeSubtract(
        unsigned long volatile *Addend,
        unsigned long          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 exchanged with the value pointed to by Target.

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 Version RTX64 3.1
Header windows.h
Library Rtx_Rtss.lib

See Also:

InterlockedExchange

InterlockedExchange8

InterlockedExchange16

InterlockedExchange64

InterlockedExchangePointer

InterlockedExchangeAdd

InterlockedExchangeAdd64