[#BloombergLP-bsls-BslLockGuard-2constructor] = xref:BloombergLP.adoc[BloombergLP]::xref:BloombergLP/bsls.adoc[bsls]::xref:BloombergLP/bsls/BslLockGuard.adoc[BslLockGuard]::BslLockGuard :relfileprefix: ../../../ :mrdocs: Create a guard object that conditionally manages the specified `lock`, and acquires the lock on `lock` by invoking its `lock` method. The behavior is undefined unless the calling thread does not already hold the lock on `lock`. Note that deadlock may result if a guard is created for `lock` while the calling thread holds the lock on `lock`. Also note that `lock` must remain valid throughout the lifetime of this guard, or until `release` is called. == Synopsis Declared in `<bsls_bsllock.h>` [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- explicit BslLockGuard(xref:BloombergLP/bsls/BslLock.adoc[BslLock]* lock); ---- [.small]#Created with https://www.mrdocs.com[MrDocs]#