[#BloombergLP-bslmt-LockGuard-2constructor-0e9] = xref:BloombergLP.adoc[BloombergLP]::xref:BloombergLP/bslmt.adoc[bslmt]::xref:BloombergLP/bslmt/LockGuard.adoc[LockGuard]::LockGuard :relfileprefix: ../../../ :mrdocs: Create a scoped guard that conditionally manages the specified `lock` (if non‐null) and invokes `lock‐>lock()`. Supplying a null `lock` has no effect. The behavior is undefined unless `lock` (if non‐null) is not already locked by this thread. Note that `lock` must remain valid throughout the lifetime of this guard, or until `release` is called. == Synopsis Declared in `<bslmt_lockguard.h>` [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- explicit LockGuard(T* lock); ---- [.small]#Created with https://www.mrdocs.com[MrDocs]#