|
BDE 4.39.x Production Release
|
#include <bslmt_qlock.h>
An efficient statically-initializable synchronization primitive that enables serialized access to shared resources. Objects of this class can only be manipulated through the use of a QLockGuard. The following idiom is used to initialize objects of type QLock:
See bslmt_qlock
Public Member Functions | |
| void | initialize () |
| bool | isLocked () const |
Public Attributes | |
| bsls::AtomicOperations::AtomicTypes::Pointer | d_guardQueueTail |
|
inline |
Set this lock into the initial unlocked state.
|
inline |
Return true if this lock is locked and false otherwise.
| bsls::AtomicOperations::AtomicTypes::Pointer bslmt::QLock::d_guardQueueTail |
Pointer to the last guard in the queue of guards waiting for this lock, or 0 if the lock is unlocked.
d_guardQueueTail points to the owner of the lock when the lock is locked and there are no additional guards waiting.It would have been preferable for this member to be private, but then this class would not be statically initializable. Also, it would have been preferable to make this member an instance of bsls::AtomicPointer<>, but again, we would lose the ability to initialize statically.