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.
|
Detailed Description
A lock (mutex) primitive.
- See Also
- ScopedMutex
Definition at line 32 of file lock.h.
Constructor & Destructor Documentation
Construct a new lock.
- Version
- 1.0
| lunchbox::Lock::~Lock |
( |
| ) |
|
Destruct the lock.
- Version
- 1.0
Member Function Documentation
| 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
| void lunchbox::Lock::setRead |
( |
| ) |
|
|
inline |
Acquire the lock shared with other readers.
- Version
- 1.3.2
Definition at line 48 of file lock.h.
| 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 51 of file lock.h.
References unset().
The documentation for this class was generated from the following file: