|
BDE 4.14.0 Production release
|
#include <bslmt_qlock.h>
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 () |
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
|
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. The behavior is undefined if the calling thread already owns the lock on qlock or if this object is in the locked state.
|
inline |
Associate this guard with the specified qlock. The behavior is undefined if this object is already in a locked state.
| int bslmt::QLockGuard::tryLock | ( | ) |
|
inline |
Release the lock on the associated QLock. The behavior is undefined unless this guard previously acquired the lock and has not already released it.