[#BloombergLP-bslmt-QLockGuard-lock-0a] = xref:BloombergLP.adoc[BloombergLP]::xref:BloombergLP/bslmt.adoc[bslmt]::xref:BloombergLP/bslmt/QLockGuard.adoc[QLockGuard]::lock :relfileprefix: ../../../ :mrdocs: Acquire a lock on the associated `QLock` object. 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 the QLock. == Synopsis Declared in `<bslmt_qlock.h>` [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- void lock(); ---- [.small]#Created with https://www.mrdocs.com[MrDocs]#