24 #ifndef _GEMA_SPIN_LOCK_H_ 25 #define _GEMA_SPIN_LOCK_H_ 27 #include <QAtomicInteger> A simple spin lock implementation based on a loop using test and set over an atomic int to change its...
Definition: gmSpinLock.h:36
GmSpinLock & _lock
The spin lock object.
Definition: gmSpinLock.h:63
RAII object used to acquire a spin lock and release it upon object destruction.
Definition: gmSpinLock.h:53
bool testAndSetAcquire(T expectedValue, T newValue)
bool tryLock()
Try to lock. Returns true if the lock was aquired, false otherwise.
Definition: gmSpinLock.h:46
GmSpinLock()
Constructor.
Definition: gmSpinLock.h:40
void storeRelease(T newValue)
~GmSpinLocker()
Destructo. Releases the lock.
Definition: gmSpinLock.h:60
GmSpinLocker(GmSpinLock &lock)
Constructor. Acquires the lock.
Definition: gmSpinLock.h:57
void unlock()
Releases the lock.
Definition: gmSpinLock.h:49
void lock()
Aquires the lock.
Definition: gmSpinLock.h:43