activemq-cpp-3.9.5
decaf::util::concurrent::Lock Class Reference

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.
 

Detailed Description

A wrapper class around a given synchronization mechanism that provides automatic release upon destruction.

Since
1.0

Constructor & Destructor Documentation

◆ Lock()

decaf::util::concurrent::Lock::Lock ( Synchronizable * object,
const bool intiallyLocked = true )

Constructor - initializes the object member and locks the object if desired.

Parameters
objectThe sync object to control
intiallyLockedIf true, the object will automatically be locked.

◆ ~Lock()

virtual decaf::util::concurrent::Lock::~Lock ( )
virtual

Destructor - Unlocks the object if it is locked.

Member Function Documentation

◆ 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 ( )

Locks the object.

◆ 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: