_InterlockedExchange Intrinsic Functions
Provide compiler intrinsic support for the Win32 Windows SDK InterlockedExchange function.
long _InterlockedExchange( long * Target, long Value ); long _InterlockedExchange_acq( long * Target, long Value ); __int64 _InterlockedExchange64( __int64 * Target, __int64 Value ); __int64 _InterlockedExchange64_acq( __int64 * Target, __int64 Value );
There are several variations on _InterlockedExchange that vary based on the data types they involve and whether processor-specific acquire or release semantics is used.
While the _InterlockedExchange function operates on 32-bit integer values, _InterlockedExchange64 operates on 64-bit integer values.
The _InterlockedExchange_acq and _InterlockedExchange64_acq intrinsic functions are the same as the corresponding functions without the _acq suffix except that the operation is performed with acquire semantics, which is useful when entering a critical section.
There is no version of this function that uses release semantics.
These functions behave as read-write memory barriers. For more information, see _ReadWriteBarrier.
These routines are only available as intrinsics.