[#BloombergLP-bsls-BslLockGuard] = xref:BloombergLP.adoc[BloombergLP]::xref:BloombergLP/bsls.adoc[bsls]::BslLockGuard :relfileprefix: ../../ :mrdocs: RAII guard that acquires and releases a `bsls::BslLock`. == Synopsis Declared in `<bsls_bsllock.h>` [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- class BslLockGuard; ---- == Description This `class` implements a guard for automatically acquiring and releasing the lock on an associated `bsls::BslLock` object. This mechanism follows the RAII idiom whereby the lock on the `BslLock` associated with a guard object is acquired upon construction and released upon destruction. == Member Functions [cols="1,4"] |=== | Name| Description | xref:BloombergLP/bsls/BslLockGuard/2constructor.adoc[`BslLockGuard`] [.small]#[constructor]# | Create a guard that manages and acquires the specified `lock`. | xref:BloombergLP/bsls/BslLockGuard/2destructor.adoc[`~BslLockGuard`] [.small]#[destructor]# | Destroy this guard and unlock its managed object, if any. | xref:BloombergLP/bsls/BslLockGuard/release.adoc[`release`] | Cease managing the current lock without unlocking it. |=== [.small]#Created with https://www.mrdocs.com[MrDocs]#