|
BDE 4.39.x Production Release
|
#include <bslmt_qlock.h>
This class provides the means to acquire and release the lock on a QLock object. Typically, the lock is acquired at construction and released automatically on destruction. This class also provides explicit lock, tryLock, and unlock primitives.
See bslmt_qlock
Public Member Functions | |
| QLockGuard () | |
| QLockGuard (QLock *qlock, bool doLock=true) | |
| ~QLockGuard () | |
| void | setQLock (QLock *qlock) |
| void | lock () |
| void | lock (QLock *qlock) |
| int | tryLock () |
| void | unlock () |
|
inline |
Create a guard in the unlocked state, not associated with any QLock objects.
|
inlineexplicit |
Create a guard associated with the specified qlock. Acquire the lock unless the (optionally) specified doLock is false. If the lock is not free, block until it can be acquired.
|
inline |
Destroy this object. If this object holds a lock, automatically free it.
| void bslmt::QLockGuard::lock | ( | ) |
|
inline |
Associate this guard with the specified qlock and acquire the lock. If the lock is not free, block until it can be acquired.
qlock or if this object is in the locked state.
|
inline |
Associate this guard with the specified qlock.
| int bslmt::QLockGuard::tryLock | ( | ) |
|
inline |
Release the lock on the associated QLock.