[#BloombergLP-bslmt-QLock]
= xref:BloombergLP.adoc[BloombergLP]::xref:BloombergLP/bslmt.adoc[bslmt]::QLock
:relfileprefix: ../../
:mrdocs:

Small, statically&hyphen;initializable mutex for serialized resource access&period;

== Synopsis

Declared in `&lt;bslmt&lowbar;qlock&period;h&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
struct QLock;
----

== Description

An efficient statically&hyphen;initializable synchronization primitive that enables serialized access to shared resources&period; Objects of this class can only be manipulated through the use of a `QLockGuard`&period; The following idiom is used to initialize objects of type `QLock`&colon; &grave; QLock mylock &equals; BSLMT&lowbar;QLOCK&lowbar;INITIALIZER&semi; &grave;

== Member Functions

[cols="1,4"]
|===
| Name| Description
| xref:BloombergLP/bslmt/QLock/initialize.adoc[`initialize`] 
| Set this lock into the initial unlocked state&period;
| xref:BloombergLP/bslmt/QLock/isLocked.adoc[`isLocked`] 
| Return `true` if this lock is locked, and `false` otherwise&period;
|===


== Data Members

[cols="1,4"]
|===
| Name| Description
| xref:BloombergLP/bslmt/QLock/d_guardQueueTail.adoc[`d&lowbar;guardQueueTail`] 
| Pointer to the last guard in the queue of guards waiting for this lock, or 0 if the lock is unlocked&period;
|===



[.small]#Created with https://www.mrdocs.com[MrDocs]#
