[#BloombergLP-bslmt-QLockGuard-lock-0f] = xref:BloombergLP.adoc[BloombergLP]::xref:BloombergLP/bslmt.adoc[bslmt]::xref:BloombergLP/bslmt/QLockGuard.adoc[QLockGuard]::lock :relfileprefix: ../../../ :mrdocs: `lock` overloads == Synopses Declared in `<bslmt_qlock.h>` 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. [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- void xref:BloombergLP/bslmt/QLockGuard/lock-0a.adoc[lock](); ---- [.small]#xref:BloombergLP/bslmt/QLockGuard/lock-0a.adoc[_» more..._]# Associate this guard with the specified `qlock` and acquire the lock. 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 `qlock` or if this object is in the locked state. [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- void xref:BloombergLP/bslmt/QLockGuard/lock-0c.adoc[lock](xref:BloombergLP/bslmt/QLock.adoc[QLock]* qlock); ---- [.small]#xref:BloombergLP/bslmt/QLockGuard/lock-0c.adoc[_» more..._]# [.small]#Created with https://www.mrdocs.com[MrDocs]#