LONG
InterlockedExchangeAdd(
IN OUT PLONG Addend,
IN LONG Value
);
InterlockedExchangeAdd adds a value to a given integer as an atomic operation and returns the initial value of the given integer.
InterlockedExchangeAdd returns the original (unsummed) value of the Addend variable.
This routine should be used in place of the previous ExInterlockedAddUlong. The new routine is faster and more efficient. 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 InterlockedExchangeAdd routine is atomic only with respect to other InterlockedXxx calls.
Callers of InterlockedExchangeAdd run at any IRQL.
InterlockedIncrement, InterlockedDecrement, ExInterlockedAddLargeInteger, ExInterlockedAddUlong