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

This type implements a scoped guard for `SpinLock`&period;

== Synopsis

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

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
class SpinLockGuard;
----

== Member Functions

[cols="1,4"]
|===
| Name| Description
| xref:BloombergLP/bsls/SpinLockGuard/2constructor.adoc[`SpinLockGuard`]         [.small]#[constructor]#
| Create a proctor object that manages the specified `lock`&period; Invoke `lock&hyphen;&gt;lock()`&period;
| xref:BloombergLP/bsls/SpinLockGuard/2destructor.adoc[`&#126;SpinLockGuard`] [.small]#[destructor]#
| Destroy this proctor object and invoke `unlock()` on the lock managed by this object&period;
| xref:BloombergLP/bsls/SpinLockGuard/release.adoc[`release`] 
| Return the lock pointer that was provided at construction and stop managing it&period; (Subsequent calls to `release()` will return null and the destruction of this object will not affect the lock&period;) The lock status is not changed by this call&period;
|===



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