activemq-cpp-3.4.0
|
A wrapper class around a given synchronization mechanism that provides automatic release upon destruction. More...
#include <src/main/decaf/util/concurrent/Lock.h>
Public Member Functions | |
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.
decaf::util::concurrent::Lock::Lock | ( | Synchronizable * | object, |
const bool | intiallyLocked = true |
||
) |
Constructor - initializes the object member and locks the object if desired.
object | The sync object to control |
intiallyLocked | If true, the object will automatically be locked. |
virtual decaf::util::concurrent::Lock::~Lock | ( | ) | [virtual] |
Destructor - Unlocks the object if it is locked.
bool decaf::util::concurrent::Lock::isLocked | ( | ) | const [inline] |
Indicates whether or not the object is locked.
void decaf::util::concurrent::Lock::lock | ( | ) |
Locks the object.
void decaf::util::concurrent::Lock::unlock | ( | ) |
Unlocks the object if it is already locked, otherwise a call to this method has no effect.