Well, then acquire/release works. But its not sufficient for certain
things. The usual pattern goes:
___________________________
LOCK(); // Atomically gain mutual exclusion
ACQUIRE_MEMBAR();
// critical section
RELEASE_MEMBAR();
UNLOCK(); // Atomically release mutual exclusion
___________________________
Now, some spinlocks need a membar in the LOCK() logic itself. And can
avoid using the acquire. Something like:
___________________________
LOCK_WITH_MEMBAR(); // Gain mutual exclusion, using something special...
//ACQUIRE_MEMBAR(); // not needed
// critical section
RELEASE_MEMBAR();
UNLOCK(); // Atomically release mutual exclusion
___________________________