_InterlockedExchangePointer Intrinsic Functions
Perform an atomic exchange operation, which copies the address passed in as the second argument to the first and returns the original address of the first.
void * _InterlockedExchangePointer( void * volatile * Target, void * Value ); void * _InterlockedExchangePointer_acq( void * volatile * Target, void * Value );
On a 64-bit system, the parameters are 64 bits and must be aligned on 64-bit boundaries; otherwise, the function fails. On a 32-bit system, the parameters are 32 bits and must be aligned on 32-bit boundaries.
Use _InterlockedExchangePointer_acq if you need acquire semantics, such as at the beginning of a critical section.
There is no version of this function that uses release semantics.
In Visual C++ 2005, these functions behave as read-write memory barriers. For more information, see _ReadWriteBarrier.
These routines are only available as intrinsics.