C language function:InterlockedExchange sample codes

Search sample code in the internet.It is the result.


TITLE : Locking mechanisms | Adi Levin's Blog for programmers
long prev_state = InterlockedExchange(&m_state,0);.......
http://adilevin.wordpress.com/2009/06/04/locking-mechanisms/


TITLE : Locking mechanisms | Adi Levin's Blog for programmers
InterlockedExchange(&m_state,1);.......
http://adilevin.wordpress.com/2009/06/04/locking-mechanisms/
TITLE : Locking mechanisms | Adi Levin's Blog for programmers
long prev_state = InterlockedExchange(&m_state,0);.......
http://adilevin.wordpress.com/2009/06/04/locking-mechanisms/
TITLE : 41423 – MemoryBarrier not available on mingw (from mingw.org) and people keep working around it
"... The InterlockedExchange() function generates a full memory barrier (or fence) and performs the exchange operation. This ensures the strict memory access ordering that is necessary,...".......
http://bugs.freedesktop.org/show_bug.cgi@id=41423
TITLE : Samples/multimedia/directshow/baseclasses/streams.h - external/webrtc/deps/third_party/winsdk_samples_v71 - Git at Google
(PVOID)InterlockedExchange((PLONG)(Target), (LONG)(Value)).......
http://chromium.googlesource.com/external/webrtc/deps/third_party/winsdk_samples_v71/+/373e927dc5ffdb61b9fb63da3d261e71f8d50dc8/Samples/multimedia/directshow/baseclasses/streams.h
search Google

https://www.google.com/#q=InterlockedExchange