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

Create a guard that conditionally acquires a write lock on `lock`&period;

== Synopsis

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

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
LockWriteGuard(
    T* lock,
    bool alreadyLockedFlag);
----

== Parameters

[cols="1,4"]
|===
| Name| Description
| *lock*
| lock object to acquire for writing&semi; may be null
| *alreadyLockedFlag*
| `true` if `lock` is already write&hyphen;locked
|===


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