[#UniqueLock]
= UniqueLock
:mrdocs:

Wrapper around std&colon;&colon;unique&lowbar;lock style lock for MutexType&period;

== Synopsis

Declared in `&lt;sync&period;h&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
template&lt;typename MutexType&gt;
class &lsqb;&lsqb;scoped&lowbar;lockable&rsqb;&rsqb; UniqueLock
    : public MutexType::unique&lowbar;lock
----

== Base Classes

[cols="1,4"]
|===
| Name| Description
| `MutexType::unique&lowbar;lock`
| 
|===

== Types

[cols="1,4"]
|===
| Name| Description
| xref:UniqueLock/reverse_lock.adoc[`reverse&lowbar;lock`] 
| An RAII&hyphen;style reverse lock&period; Unlocks on construction and locks on destruction&period;
|===


== Member Functions

[cols="1,4"]
|===
| Name| Description
| xref:UniqueLock/2constructor-05.adoc[`UniqueLock`]         [.small]#[constructor]#
| Acquire a lock on the given mutex, registering it for lock&hyphen;order checking&period;
| xref:UniqueLock/2constructor-0c.adoc[`UniqueLock`]         [.small]#[constructor]#
| Acquire a lock on the given mutex pointer, doing nothing if it is null&period;
| xref:UniqueLock/2destructor.adoc[`&#126;UniqueLock`] [.small]#[destructor]#
| Release the lock if held and update lock&hyphen;order bookkeeping&period;
| xref:UniqueLock/2conversion.adoc[`operator bool`] 
| Report whether this lock currently owns its mutex&period;
|===


== Protected Member Functions

[cols="1,4"]
|===
| Name| Description
| xref:UniqueLock/2constructor-07.adoc[`UniqueLock`]         [.small]#[constructor]#
| Construct an empty lock that owns no mutex (needed for reverse&lowbar;lock)&period;
|===


== Friends

[cols="1,4"]
|===
| Name| Description
| `xref:UniqueLock/reverse_lock.adoc[UniqueLock::reverse&lowbar;lock]`
| An RAII&hyphen;style reverse lock&period; Unlocks on construction and locks on destruction&period;
|===


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