InterlockedIncrement

LONG
InterlockedIncrement(
IN PLONG 
Addend
);

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

Parameters

Addend

Points to a variable whose value is to be incremented.

Return Value

InterlockedIncrement returns the incremented value.

Comments

This routine should be used in place of the previous ExInterlockedIncrementLong. The new routine is more efficient and faster. It 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.

The InterlockedIncrement routine is atomic only with respect to other InterlockedXxxxxx calls.

Callers of InterlockedIncrement run at any IRQL.

See Also

InterlockedDecrement, InterlockedExchange, ExInterlockedAddLargeInteger, ExInterlockedAddUlong