#include <Pt/System/Mutex.h>
Reader lock object for read-write mutexes.
Inherits NonCopyable.
Public Member Functions | |
| ReadLock (ReadWriteMutex &m, bool doLock=true, bool isLocked=false) | |
| Construct to guard a ReadWriteMutex. More... | |
| ~ReadLock () | |
| Unlocks the mutex unless unlock() was called. | |
| void | lock () |
| Locks the mutex. | |
| ReadWriteMutex & | mutex () |
| Returns the guarded the mutex object. | |
| void | unlock () |
| Unlocks the mutex. | |
| ReadLock | ( | ReadWriteMutex & | m, |
| bool | doLock = true, |
||
| bool | isLocked = false |
||
| ) |
Constructs a ReadLock object and locks the enclosing read-write mutex if doLock is true. If isLocked is true, the ReadLock will only unlock the given mutex in the destructor, but not lock it in the constructor.