Quote Originally Posted by cronodragon
"Waits for ownership of the specified critical section object. The function returns when the calling thread is granted ownership.... The threads of a single process can use a critical section object for mutual-exclusion synchronization"
This is about EnterCriticalSection right? See TryEnterCriticalSection description. AFAIK it's implemented using system InterlockedCompareExchange function which is implemented via CMPXCHG.
In FastMM sources used CMPXCHG assembler instructions.