A wrapper class around a given synchronization mechanism that provides automatic release upon destruction.
More...
#include <src/main/decaf/util/concurrent/Lock.h>
|
| Lock (Synchronizable *object, const bool intiallyLocked=true) |
| Constructor - initializes the object member and locks the object if desired.
|
|
virtual | ~Lock () |
| Destructor - Unlocks the object if it is locked.
|
|
void | lock () |
| Locks the object.
|
|
void | unlock () |
| Unlocks the object if it is already locked, otherwise a call to this method has no effect.
|
|
bool | isLocked () const |
| Indicates whether or not the object is locked.
|
|
A wrapper class around a given synchronization mechanism that provides automatic release upon destruction.
- Since
- 1.0
◆ Lock()
decaf::util::concurrent::Lock::Lock |
( |
Synchronizable * | object, |
|
|
const bool | intiallyLocked = true ) |
Constructor - initializes the object member and locks the object if desired.
- Parameters
-
object | The sync object to control |
intiallyLocked | If true, the object will automatically be locked. |
◆ ~Lock()
virtual decaf::util::concurrent::Lock::~Lock |
( |
| ) |
|
|
virtual |
Destructor - Unlocks the object if it is locked.
◆ isLocked()
bool decaf::util::concurrent::Lock::isLocked |
( |
| ) |
const |
|
inline |
Indicates whether or not the object is locked.
- Returns
- true if the object is locked, otherwise false.
◆ lock()
void decaf::util::concurrent::Lock::lock |
( |
| ) |
|
◆ unlock()
void decaf::util::concurrent::Lock::unlock |
( |
| ) |
|
Unlocks the object if it is already locked, otherwise a call to this method has no effect.
The documentation for this class was generated from the following file:
- src/main/decaf/util/concurrent/Lock.h