[#BloombergLP-bslmt-QLock] = xref:BloombergLP.adoc[BloombergLP]::xref:BloombergLP/bslmt.adoc[bslmt]::QLock :relfileprefix: ../../ :mrdocs: Small, statically‐initializable mutex for serialized resource access. == Synopsis Declared in `<bslmt_qlock.h>` [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- struct QLock; ---- == Description 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`: ` QLock mylock = BSLMT_QLOCK_INITIALIZER; ` == Member Functions [cols="1,4"] |=== | Name| Description | xref:BloombergLP/bslmt/QLock/initialize.adoc[`initialize`] | Set this lock into the initial unlocked state. | xref:BloombergLP/bslmt/QLock/isLocked.adoc[`isLocked`] | Return `true` if this lock is locked, and `false` otherwise. |=== == Data Members [cols="1,4"] |=== | Name| Description | xref:BloombergLP/bslmt/QLock/d_guardQueueTail.adoc[`d_guardQueueTail`] | Pointer to the last guard in the queue of guards waiting for this lock, or 0 if the lock is unlocked. |=== [.small]#Created with https://www.mrdocs.com[MrDocs]#