[#BloombergLP-bslmt-QLockGuard-2constructor-0f] = xref:BloombergLP.adoc[BloombergLP]::xref:BloombergLP/bslmt.adoc[bslmt]::xref:BloombergLP/bslmt/QLockGuard.adoc[QLockGuard]::QLockGuard :relfileprefix: ../../../ :mrdocs: 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. == Synopsis Declared in `<bslmt_qlock.h>` [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- explicit QLockGuard( xref:BloombergLP/bslmt/QLock.adoc[QLock]* qlock, bool doLock = true); ---- [.small]#Created with https://www.mrdocs.com[MrDocs]#