InterlockedDecrement

LONG
InterlockedDecrement(
IN PLONG 
Addend
);

Decrements a caller supplied variable of type LONG as an atomic operation.

Parameters

Addend

Points to a variable whose value is to be decremented.

Return Value

InterlockedDecrement returns the decremented value.

Comments

InterlockedDecrement should be used in place of the previous ExInterlockedDecrementLong. InterlockedDecrement is more efficient and faster. This routine is implemented inline by the compiler when appropriate and possible. The routine does not require a spin lock and can therefore be safely used on pageable data.

InterlockedDecrement is atomic only with respect to other InterlockedXxxxxx calls.

Callers of InterlockedDecrement run at any IRQL.

See Also

InterlockedIncrement, InterlockedExchange, ExInterlockedAddLargeInteger, ExInterlockedAddUlong