Created
September 27, 2013 12:11
-
-
Save RklAlx/6727688 to your computer and use it in GitHub Desktop.
InterlockedCompare
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
Syntax: | |
LONG __cdecl InterlockedCompareExchange(__inout LONG volatile *Destination, | |
__in LONG Exchange, | |
__in LONG Comparand | |
); | |
Returns the initial value of 'Destination'. | |
Note: | |
To operate on 64-bit values, use the InterlockedCompareExchange64 function. | |
*/ | |
LONG curr_value; | |
LONG new_value; | |
LONG seed; | |
cur_value = InterlockedCompareExchange(&seed, new_value, old_value); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment