[#BloombergLP-bsls-BslLockGuard]
= xref:BloombergLP.adoc[BloombergLP]::xref:BloombergLP/bsls.adoc[bsls]::BslLockGuard
:relfileprefix: ../../
:mrdocs:

RAII guard that acquires and releases a `bsls&colon;&colon;BslLock`&period;

== Synopsis

Declared in `&lt;bsls&lowbar;bsllock&period;h&gt;`

[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&colon;&colon;BslLock` object&period; 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&period;

== 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`&period;
| xref:BloombergLP/bsls/BslLockGuard/2destructor.adoc[`&#126;BslLockGuard`] [.small]#[destructor]#
| Destroy this guard and unlock its managed object, if any&period;
| xref:BloombergLP/bsls/BslLockGuard/release.adoc[`release`] 
| Cease managing the current lock without unlocking it&period;
|===



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