[#UniqueLock-2constructor-05]
= xref:UniqueLock.adoc[UniqueLock]::UniqueLock
:relfileprefix: ../
:mrdocs:

Acquire a lock on the given mutex, registering it for lock&hyphen;order checking&period;

== Synopsis

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

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
&lsqb;&lsqb;acquire&lowbar;capability(0x7f2e18929b38), acquire&lowbar;capability(0x7f2e18c0fe98), acquire&lowbar;capability(0x7f2e324d9268), acquire&lowbar;capability(0x7f2e40253018), acquire&lowbar;capability(0x7f2e36f536f8), acquire&lowbar;capability(0x7f2e2a2fe678), acquire&lowbar;capability(0x7f2e37b26768), acquire&lowbar;capability(0x7f2e30122a58), acquire&lowbar;capability(0x7f2e3b4d4058), acquire&lowbar;capability(0x7f2e22085d88), acquire&lowbar;capability(0x7f2e25f32b08), acquire&lowbar;capability(0x7f2e42e80858), acquire&lowbar;capability(0x7f2e3ba272d8), acquire&lowbar;capability(0x7f2e31c46668), acquire&lowbar;capability(0x7f2e225a23d8), acquire&lowbar;capability(0x7f2e323643b8), acquire&lowbar;capability(0x7f2e36235328), acquire&lowbar;capability(0x7f2e23dd69c8), acquire&lowbar;capability(0x7f2e1c7068c8), acquire&lowbar;capability(0x7f2e21ec8bb8), acquire&lowbar;capability(0x7f2e3043f0f8), acquire&lowbar;capability(0x7f2e36bf2f38), acquire&lowbar;capability(0x7f2e33a4c158), acquire&lowbar;capability(0x7f2e22539db8), acquire&lowbar;capability(0x7f2e1bc29238), acquire&lowbar;capability(0x7f2e29c6a8f8), acquire&lowbar;capability(0x7f2e19a5b238), acquire&lowbar;capability(0x7f2e146d5408), acquire&lowbar;capability(0x7f2e41a6c7f8), acquire&lowbar;capability(0x7f2e36f4bcd8), acquire&lowbar;capability(0x7f2e1be60ce8), acquire&lowbar;capability(0x7f2e30e44078), acquire&lowbar;capability(0x7f2e29cd2538), acquire&lowbar;capability(0x7f2e3aa8f468), acquire&lowbar;capability(0x7f2e43f228c8), acquire&lowbar;capability(0x7f2e30e1a188), acquire&lowbar;capability(0x7f2e23210c48), acquire&lowbar;capability(0x7f2e362dd698), acquire&lowbar;capability(0x7f2e1419e6b8), acquire&lowbar;capability(0x7f2e357b8fd8), acquire&lowbar;capability(0x7f2e188a1bf8), acquire&lowbar;capability(0x7f2e249046b8), acquire&lowbar;capability(0x7f2e28580108), acquire&lowbar;capability(0x7f2e3ad5a938), acquire&lowbar;capability(0x7f2e3376b2f8), acquire&lowbar;capability(0x7f2e370f0b38), acquire&lowbar;capability(0x7f2e30c0afd8), acquire&lowbar;capability(0x7f2e2a6b17f8), acquire&lowbar;capability(0x7f2e0800d248), acquire&lowbar;capability(0x7f2e3ab4d7b8), acquire&lowbar;capability(0x7f2e26d2f528), acquire&lowbar;capability(0x7f2e1d2c8d28), acquire&lowbar;capability(0x7f2e08464c08), acquire&lowbar;capability(0x7f2e1c59b918), acquire&lowbar;capability(0x7f2e38a105c8), acquire&lowbar;capability(0x7f2e14062f28), acquire&lowbar;capability(0x7f2e197618f8), acquire&lowbar;capability(0x7f2e2ab62148), acquire&lowbar;capability(0x7f2e42e83848), acquire&lowbar;capability(0x7f2e24183b28), acquire&lowbar;capability(0x7f2e3a6c78b8), acquire&lowbar;capability(0x7f2e11f17fa8), acquire&lowbar;capability(0x7f2e1446d198), acquire&lowbar;capability(0x7f2e19a79f78), acquire&lowbar;capability(0x7f2e297bb038), acquire&lowbar;capability(0x7f2e31e48b98), acquire&lowbar;capability(0x7f2e395e18f8), acquire&lowbar;capability(0x7f2e403c79a8), acquire&lowbar;capability(0x7f2e3103ff78), acquire&lowbar;capability(0x7f2e22233618), acquire&lowbar;capability(0x7f2e1b679718), acquire&lowbar;capability(0x7f2e33027ae8), acquire&lowbar;capability(0x7f2e36fe4c98), acquire&lowbar;capability(0x7f2e3840b488), acquire&lowbar;capability(0x7f2e23929918), acquire&lowbar;capability(0x7f2e28ce48c8), acquire&lowbar;capability(0x7f2e31267d58), acquire&lowbar;capability(0x7f2e35bea148), acquire&lowbar;capability(0x7f2e1e8aade8)&rsqb;&rsqb;
UniqueLock(
    MutexType& mutexIn,
    char const* pszName,
    char const* pszFile,
    int nLine,
    bool fTry = false);
----

== Parameters

[cols="1,4"]
|===
| Name| Description
| *mutexIn*
| Mutex to lock&period;
| *pszName*
| Name of the mutex&period;
| *pszFile*
| Source file of the caller&period;
| *nLine*
| Source line of the caller&period;
| *fTry*
| Whether to attempt a non&hyphen;blocking try&hyphen;lock instead of blocking&period;
|===


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