[#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(0x7f95008416f8), acquire&lowbar;capability(0x7f9525cc6fd8), acquire&lowbar;capability(0x7f950db722e8), acquire&lowbar;capability(0x7f951f578808), acquire&lowbar;capability(0x7f950c188e58), acquire&lowbar;capability(0x7f950e1b3bc8), acquire&lowbar;capability(0x7f9522ff7298), acquire&lowbar;capability(0x7f951c782c68), acquire&lowbar;capability(0x7f951414ee28), acquire&lowbar;capability(0x7f950a044988), acquire&lowbar;capability(0x7f9502087ab8), acquire&lowbar;capability(0x7f9515b29d98), acquire&lowbar;capability(0x7f9527a099c8), acquire&lowbar;capability(0x7f951c794dd8), acquire&lowbar;capability(0x7f95220d60d8), acquire&lowbar;capability(0x7f9503cc7c58), acquire&lowbar;capability(0x7f9527b0c1d8), acquire&lowbar;capability(0x7f950db4c958), acquire&lowbar;capability(0x7f9525eeeed8), acquire&lowbar;capability(0x7f9521a99de8), acquire&lowbar;capability(0x7f951f7c2208), acquire&lowbar;capability(0x7f9527a70398), acquire&lowbar;capability(0x7f9500b1bd58), acquire&lowbar;capability(0x7f950f391098), acquire&lowbar;capability(0x7f950345fe38), acquire&lowbar;capability(0x7f950833b698), acquire&lowbar;capability(0x7f95039cdda8), acquire&lowbar;capability(0x7f9513c15b88), acquire&lowbar;capability(0x7f950fa3c2f8), acquire&lowbar;capability(0x7f94f8958bc8), acquire&lowbar;capability(0x7f951d592dd8), acquire&lowbar;capability(0x7f951715c938), acquire&lowbar;capability(0x7f95088b2718), acquire&lowbar;capability(0x7f951e6229e8), acquire&lowbar;capability(0x7f950f8a8098), acquire&lowbar;capability(0x7f94f0888358), acquire&lowbar;capability(0x7f950e102458), acquire&lowbar;capability(0x7f9527a514b8), acquire&lowbar;capability(0x7f95104b2688), acquire&lowbar;capability(0x7f950bbe4028), acquire&lowbar;capability(0x7f9517b76b58), acquire&lowbar;capability(0x7f951ea727a8), acquire&lowbar;capability(0x7f950a203088), acquire&lowbar;capability(0x7f9527c3c508), acquire&lowbar;capability(0x7f9513f88f48), acquire&lowbar;capability(0x7f9523f11368), acquire&lowbar;capability(0x7f9516a0f788), acquire&lowbar;capability(0x7f9503672ec8), acquire&lowbar;capability(0x7f9513c3d7a8), acquire&lowbar;capability(0x7f9526266258), acquire&lowbar;capability(0x7f9523c2ef48), acquire&lowbar;capability(0x7f951d2a2de8), acquire&lowbar;capability(0x7f952678de18), acquire&lowbar;capability(0x7f950165f688), acquire&lowbar;capability(0x7f95082c7d98), acquire&lowbar;capability(0x7f9523c2a548), acquire&lowbar;capability(0x7f9509278aa8), acquire&lowbar;capability(0x7f951c5ad588), acquire&lowbar;capability(0x7f950c2ec6d8), acquire&lowbar;capability(0x7f951250ac78), acquire&lowbar;capability(0x7f9508140558), acquire&lowbar;capability(0x7f95066ecd08), acquire&lowbar;capability(0x7f9510f52d48), acquire&lowbar;capability(0x7f9501a15748), acquire&lowbar;capability(0x7f9508b7ffe8), acquire&lowbar;capability(0x7f952165f5a8), acquire&lowbar;capability(0x7f9517b0e848), acquire&lowbar;capability(0x7f9502e539f8), acquire&lowbar;capability(0x7f950da856f8), acquire&lowbar;capability(0x7f94fc853568), acquire&lowbar;capability(0x7f94f8a87f48), acquire&lowbar;capability(0x7f951fe81348), acquire&lowbar;capability(0x7f94f066d358), acquire&lowbar;capability(0x7f952503c898), acquire&lowbar;capability(0x7f950697e4b8), acquire&lowbar;capability(0x7f9515b870c8), acquire&lowbar;capability(0x7f9503850bf8), acquire&lowbar;capability(0x7f951494fd88), acquire&lowbar;capability(0x7f95157b9538)&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]#
