[#BloombergLP-bslmt-QLockGuard-lock-0c]
= xref:BloombergLP.adoc[BloombergLP]::xref:BloombergLP/bslmt.adoc[bslmt]::xref:BloombergLP/bslmt/QLockGuard.adoc[QLockGuard]::lock
:relfileprefix: ../../../
:mrdocs:

Associate this guard with the specified `qlock` and acquire the lock&period; If the `lock` is not free, block until it can be acquired&period; The behavior is undefined if the calling thread already owns the lock on `qlock` or if this object is in the locked state&period;

== Synopsis

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

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
void
lock(xref:BloombergLP/bslmt/QLock.adoc[QLock]* qlock);
----


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