Equalizer 1.0
|
A fast lock for uncontended memory access. More...
#include <spinLock.h>
Public Member Functions | |
SpinLock () | |
Construct a new lock. | |
~SpinLock () | |
Destruct the lock. | |
void | set () |
Acquire the lock. | |
void | unset () |
Release the lock. | |
bool | trySet () |
Attempt to acquire the lock. | |
bool | isSet () |
Test if the lock is set. |
A fast lock for uncontended memory access.
Be aware of possible priority inversion.
Definition at line 37 of file spinLock.h.
co::base::SpinLock::SpinLock | ( | ) | [inline] |
co::base::SpinLock::~SpinLock | ( | ) | [inline] |
bool co::base::SpinLock::isSet | ( | ) | [inline] |
Test if the lock is set.
true
if the lock is set, false
if it is not set. Definition at line 86 of file spinLock.h.
void co::base::SpinLock::set | ( | ) | [inline] |
bool co::base::SpinLock::trySet | ( | ) | [inline] |
Attempt to acquire the lock.
This method implements an atomic test-and-set operation.
true
if the lock was set, false
if it was not set. Definition at line 72 of file spinLock.h.
void co::base::SpinLock::unset | ( | ) | [inline] |