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:37
GmSpinLock()
Constructor.
Definition gmSpinLock.h:40
bool tryLock()
Try to lock. Returns true if the lock was aquired, false otherwise.
Definition gmSpinLock.h:46
void lock()
Aquires the lock.
Definition gmSpinLock.h:43
void unlock()
Releases the lock.
Definition gmSpinLock.h:49
RAII object used to acquire a spin lock and release it upon object destruction.
Definition gmSpinLock.h:54
GmSpinLock & _lock
The spin lock object.
Definition gmSpinLock.h:63
GmSpinLocker(GmSpinLock &lock)
Constructor. Acquires the lock.
Definition gmSpinLock.h:57
~GmSpinLocker()
Destructo. Releases the lock.
Definition gmSpinLock.h:60
void storeRelease(T newValue)
bool testAndSetAcquire(T expectedValue, T newValue)