RecursiveLock Class Reference

#include <Pt/System/Mutex.h>

Lock class for recursive mutexes.

Inherits NonCopyable.

Public Member Functions

 RecursiveLock (RecursiveMutex &m, bool doLock=true, bool isLocked=false)
 Construct to guard a RecursiveMutex. More...
 
 ~RecursiveLock ()
 Unlocks the mutex unless unlock() was called.
 
void lock ()
 Locks the mutex.
 
RecursiveMutexmutex ()
 Returns the guarded the mutex object.
 
const RecursiveMutexmutex () const
 Returns the guarded the mutex object.
 
void unlock ()
 Unlocks the mutex.
 

Constructor & Destructor Documentation

RecursiveLock ( RecursiveMutex m,
bool  doLock = true,
bool  isLocked = false 
)

Constructs a RecursiveLock object and locks the enclosing recursive mutex if doLock is true. If isLocked is true, the RecursiveLock will only unlock the given mutex in the destructor, but not lock it in the constructor.