Lunchbox
1.4.0
|
A lock (mutex) primitive. More...
#include <lock.h>
Public Member Functions | |
Lock () | |
Construct a new lock. | |
~Lock () | |
Destruct the lock. | |
void | set () |
Acquire the lock. | |
void | unset () |
Release the lock. | |
void | setRead () |
Acquire the lock shared with other readers. | |
void | unsetRead () |
Release a shared read lock. | |
bool | trySet () |
Attempt to acquire the lock. | |
bool | isSet () |
Test if the lock is set. |
Construct a new lock.
Destruct the lock.
bool lunchbox::Lock::isSet | ( | ) |
Test if the lock is set.
true
if the lock is set, false
if it is not set. void lunchbox::Lock::set | ( | ) |
Acquire the lock.
void lunchbox::Lock::setRead | ( | ) | [inline] |
bool lunchbox::Lock::trySet | ( | ) |
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. void lunchbox::Lock::unset | ( | ) |
Release the lock.
Referenced by unsetRead().
void lunchbox::Lock::unsetRead | ( | ) | [inline] |