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

Acquire a lock on the given mutex pointer, doing nothing if it is null&period;

== Synopsis

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

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
&lsqb;&lsqb;acquire&lowbar;capability(0x7f2e18929bd8), acquire&lowbar;capability(0x7f2e18c0ff38), acquire&lowbar;capability(0x7f2e324d9308), acquire&lowbar;capability(0x7f2e402530b8), acquire&lowbar;capability(0x7f2e36f53798), acquire&lowbar;capability(0x7f2e2a2fe718), acquire&lowbar;capability(0x7f2e37b26808), acquire&lowbar;capability(0x7f2e30122af8), acquire&lowbar;capability(0x7f2e3b4d40f8), acquire&lowbar;capability(0x7f2e22085e28), acquire&lowbar;capability(0x7f2e25f32ba8), acquire&lowbar;capability(0x7f2e42e808f8), acquire&lowbar;capability(0x7f2e3ba27378), acquire&lowbar;capability(0x7f2e31c46708), acquire&lowbar;capability(0x7f2e225a2478), acquire&lowbar;capability(0x7f2e32364458), acquire&lowbar;capability(0x7f2e362353c8), acquire&lowbar;capability(0x7f2e23dd6a68), acquire&lowbar;capability(0x7f2e1c706968), acquire&lowbar;capability(0x7f2e21ec8c58), acquire&lowbar;capability(0x7f2e3043f198), acquire&lowbar;capability(0x7f2e36bf2fd8), acquire&lowbar;capability(0x7f2e33a4c1f8), acquire&lowbar;capability(0x7f2e22539e58), acquire&lowbar;capability(0x7f2e1bc292d8), acquire&lowbar;capability(0x7f2e29c6a998), acquire&lowbar;capability(0x7f2e19a5b2d8), acquire&lowbar;capability(0x7f2e146d54a8), acquire&lowbar;capability(0x7f2e41a6c898), acquire&lowbar;capability(0x7f2e36f4bd78), acquire&lowbar;capability(0x7f2e1be60d88), acquire&lowbar;capability(0x7f2e30e44118), acquire&lowbar;capability(0x7f2e29cd25d8), acquire&lowbar;capability(0x7f2e3aa8f508), acquire&lowbar;capability(0x7f2e43f22968), acquire&lowbar;capability(0x7f2e30e1a228), acquire&lowbar;capability(0x7f2e23210ce8), acquire&lowbar;capability(0x7f2e362dd738), acquire&lowbar;capability(0x7f2e1419e758), acquire&lowbar;capability(0x7f2e357b9078), acquire&lowbar;capability(0x7f2e188a1c98), acquire&lowbar;capability(0x7f2e24904758), acquire&lowbar;capability(0x7f2e285801a8), acquire&lowbar;capability(0x7f2e3ad5a9d8), acquire&lowbar;capability(0x7f2e3376b398), acquire&lowbar;capability(0x7f2e370f0bd8), acquire&lowbar;capability(0x7f2e30c0b078), acquire&lowbar;capability(0x7f2e2a6b1898), acquire&lowbar;capability(0x7f2e0800d2e8), acquire&lowbar;capability(0x7f2e3ab4d858), acquire&lowbar;capability(0x7f2e26d2f5c8), acquire&lowbar;capability(0x7f2e1d2c8dc8), acquire&lowbar;capability(0x7f2e08464ca8), acquire&lowbar;capability(0x7f2e1c59b9b8), acquire&lowbar;capability(0x7f2e38a10668), acquire&lowbar;capability(0x7f2e14062fc8), acquire&lowbar;capability(0x7f2e19761998), acquire&lowbar;capability(0x7f2e2ab621e8), acquire&lowbar;capability(0x7f2e42e838e8), acquire&lowbar;capability(0x7f2e24183bc8), acquire&lowbar;capability(0x7f2e3a6c7958), acquire&lowbar;capability(0x7f2e11f18048), acquire&lowbar;capability(0x7f2e1446d238), acquire&lowbar;capability(0x7f2e19a7a018), acquire&lowbar;capability(0x7f2e297bb0d8), acquire&lowbar;capability(0x7f2e31e48c38), acquire&lowbar;capability(0x7f2e395e1998), acquire&lowbar;capability(0x7f2e403c7a48), acquire&lowbar;capability(0x7f2e31040018), acquire&lowbar;capability(0x7f2e222336b8), acquire&lowbar;capability(0x7f2e1b6797b8), acquire&lowbar;capability(0x7f2e33027b88), acquire&lowbar;capability(0x7f2e36fe4d38), acquire&lowbar;capability(0x7f2e3840b528), acquire&lowbar;capability(0x7f2e239299b8), acquire&lowbar;capability(0x7f2e28ce4968), acquire&lowbar;capability(0x7f2e31267df8), acquire&lowbar;capability(0x7f2e35bea1e8), acquire&lowbar;capability(0x7f2e1e8aae88)&rsqb;&rsqb;
UniqueLock(
    MutexType* pmutexIn,
    char const* pszName,
    char const* pszFile,
    int nLine,
    bool fTry = false);
----

== Parameters

[cols="1,4"]
|===
| Name| Description
| *pmutexIn*
| Mutex to lock, or null to construct an empty 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]#
