A lock (mutex) primitive.
More...
#include <lock.h>
A lock (mutex) primitive.
- See also
- ScopedMutex
- Deprecated:
- Use boost::mutex
Example:
Definition at line 36 of file lock.h.
Construct a new lock.
- Version
- 1.0
lunchbox::Lock::~Lock |
( |
| ) |
|
Destruct the lock.
- Version
- 1.0
bool lunchbox::Lock::isSet |
( |
| ) |
|
Test if the lock is set.
- Returns
true
if the lock is set, false
if it is not set.
- Version
- 1.0
void lunchbox::Lock::set |
( |
| ) |
|
Acquire the lock.
- Version
- 1.0
Referenced by setRead().
void lunchbox::Lock::setRead |
( |
| ) |
|
|
inline |
Acquire the lock shared with other readers.
- Version
- 1.3.2
Definition at line 52 of file lock.h.
References set().
bool lunchbox::Lock::trySet |
( |
| ) |
|
Attempt to acquire the lock.
This method implements an atomic test-and-set operation.
- Returns
true
if the lock was set, false
if it was not set.
- Version
- 1.0
void lunchbox::Lock::unset |
( |
| ) |
|
Release the lock.
- Version
- 1.0
Referenced by unsetRead().
void lunchbox::Lock::unsetRead |
( |
| ) |
|
|
inline |
Release a shared read lock.
- Version
- 1.3.2
Definition at line 55 of file lock.h.
References unset().
The documentation for this class was generated from the following file: