[#BloombergLP-bslmt-QLockGuard-2constructor-09]
= xref:BloombergLP.adoc[BloombergLP]::xref:BloombergLP/bslmt.adoc[bslmt]::xref:BloombergLP/bslmt/QLockGuard.adoc[QLockGuard]::QLockGuard
:relfileprefix: ../../../
:mrdocs:

Constructors

== Synopses

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

Create a guard in the unlocked state, not associated with any `QLock` objects&period;


[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
xref:BloombergLP/bslmt/QLockGuard/2constructor-07.adoc[QLockGuard]();
----

[.small]#xref:BloombergLP/bslmt/QLockGuard/2constructor-07.adoc[_» more&period;&period;&period;_]#

Create a guard associated with the specified `qlock`&period;


[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
explicit
xref:BloombergLP/bslmt/QLockGuard/2constructor-0f.adoc[QLockGuard](
    xref:BloombergLP/bslmt/QLock.adoc[QLock]* qlock,
    bool doLock = true);
----

[.small]#xref:BloombergLP/bslmt/QLockGuard/2constructor-0f.adoc[_» more&period;&period;&period;_]#

== Parameters

[cols="1,4"]
|===
| Name| Description
| *qlock*
| QLock with which to associate this guard
| *doLock*
| if `true` (the default), acquire the lock on construction
|===


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