interlocked_decrement


int interlocked_decrement(int* subtrahend)

This function decrements the specified integer and checks the resulting value.

Parameters

int* subtrahend

A pointer to an integer to be decremented. The value pointed to should be aligned on a 32 bit boundary.

Return

int

The decremented value.

Notes

This function may be used to decrement (subtract 1 from) a variable and check the result without the possibility of that value being changed by another thread between the time it is decremented and the time its new value is returned.