Export (0) Print
Expand All
Expand Minimize

InterlockedDecrement routine

The InterlockedDecrement routine decrements a caller-supplied variable of type LONG as an atomic operation.

Syntax


LONG InterlockedDecrement(
  _Inout_  LONG volatile *Addend
);

Parameters

Addend [in, out]

A pointer to a variable to be decremented.

Return value

InterlockedDecrement returns the decremented value.

Remarks

InterlockedDecrement should be used instead of ExInterlockedDecrementLong because it is both more efficient and faster.

InterlockedDecrement is implemented inline by the compiler when appropriate and possible. It does not require a spin lock and can therefore be safely used on pageable data.

InterlockedDecrement is atomic only with respect to other InterlockedXxx calls.

Interlocked operations cannot be used on non-cached memory.

Requirements

Version

Available starting with Windows 2000.

Header

Wdm.h (include Wdm.h, Ntddk.h, or Ntifs.h)

IRQL

Any level

See also

InterlockedExchange
InterlockedIncrement
ExInterlockedAddLargeInteger
ExInterlockedAddUlong

 

 

Send comments about this topic to Microsoft

Show:
© 2014 Microsoft