[#MaybeCheckNotHeld-0f]
= MaybeCheckNotHeld
:mrdocs:

`MaybeCheckNotHeld` overloads

== Synopses

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

Require negative capability on a Mutex before locking it and pass it through&period;


[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
&lsqb;&lsqb;requires&lowbar;capability(0x7f2e1892a1c8), lock&lowbar;returned(cs), requires&lowbar;capability(0x7f2e18c10528), requires&lowbar;capability(0x7f2e324d98f8), requires&lowbar;capability(0x7f2e402536a8), requires&lowbar;capability(0x7f2e36f53d88), requires&lowbar;capability(0x7f2e2a2fed08), requires&lowbar;capability(0x7f2e37b26df8), requires&lowbar;capability(0x7f2e301230e8), requires&lowbar;capability(0x7f2e3b4d46e8), requires&lowbar;capability(0x7f2e22086418), requires&lowbar;capability(0x7f2e25f33198), requires&lowbar;capability(0x7f2e42e80ee8), requires&lowbar;capability(0x7f2e3ba27968), requires&lowbar;capability(0x7f2e31c46cf8), requires&lowbar;capability(0x7f2e225a2a68), requires&lowbar;capability(0x7f2e32364a48), requires&lowbar;capability(0x7f2e362359b8), requires&lowbar;capability(0x7f2e23dd7058), requires&lowbar;capability(0x7f2e1c706f58), requires&lowbar;capability(0x7f2e21ec9248), requires&lowbar;capability(0x7f2e3043f788), requires&lowbar;capability(0x7f2e36bf35c8), requires&lowbar;capability(0x7f2e33a4c7e8), requires&lowbar;capability(0x7f2e2253a448), requires&lowbar;capability(0x7f2e1bc298c8), requires&lowbar;capability(0x7f2e29c6af88), requires&lowbar;capability(0x7f2e19a5b8c8), requires&lowbar;capability(0x7f2e146d5a98), requires&lowbar;capability(0x7f2e41a6ce88), requires&lowbar;capability(0x7f2e36f4c368), requires&lowbar;capability(0x7f2e1be61378), requires&lowbar;capability(0x7f2e30e44708), requires&lowbar;capability(0x7f2e29cd2bc8), requires&lowbar;capability(0x7f2e3aa8faf8), requires&lowbar;capability(0x7f2e43f22f58), requires&lowbar;capability(0x7f2e30e1a818), requires&lowbar;capability(0x7f2e232112d8), requires&lowbar;capability(0x7f2e362ddd28), requires&lowbar;capability(0x7f2e1419ed48), requires&lowbar;capability(0x7f2e357b9668), requires&lowbar;capability(0x7f2e188a2288), requires&lowbar;capability(0x7f2e24904d48), requires&lowbar;capability(0x7f2e28580798), requires&lowbar;capability(0x7f2e3ad5afc8), requires&lowbar;capability(0x7f2e3376b988), requires&lowbar;capability(0x7f2e370f11c8), requires&lowbar;capability(0x7f2e30c0b668), requires&lowbar;capability(0x7f2e2a6b1e88), requires&lowbar;capability(0x7f2e0800d8d8), requires&lowbar;capability(0x7f2e3ab4de48), requires&lowbar;capability(0x7f2e26d2fbb8), requires&lowbar;capability(0x7f2e1d2c93b8), requires&lowbar;capability(0x7f2e08465298), requires&lowbar;capability(0x7f2e1c59bfa8), requires&lowbar;capability(0x7f2e38a10c58), requires&lowbar;capability(0x7f2e140635b8), requires&lowbar;capability(0x7f2e19761f88), requires&lowbar;capability(0x7f2e2ab627d8), requires&lowbar;capability(0x7f2e42e83ed8), requires&lowbar;capability(0x7f2e241841b8), requires&lowbar;capability(0x7f2e3a6c7f48), requires&lowbar;capability(0x7f2e11f18638), requires&lowbar;capability(0x7f2e1446d828), requires&lowbar;capability(0x7f2e19a7a608), requires&lowbar;capability(0x7f2e297bb6c8), requires&lowbar;capability(0x7f2e31e49228), requires&lowbar;capability(0x7f2e395e1f88), requires&lowbar;capability(0x7f2e403c8038), requires&lowbar;capability(0x7f2e31040608), requires&lowbar;capability(0x7f2e22233ca8), requires&lowbar;capability(0x7f2e1b679da8), requires&lowbar;capability(0x7f2e33028178), requires&lowbar;capability(0x7f2e36fe5328), requires&lowbar;capability(0x7f2e3840bb18), requires&lowbar;capability(0x7f2e23929fa8), requires&lowbar;capability(0x7f2e28ce4f58), requires&lowbar;capability(0x7f2e312683e8), requires&lowbar;capability(0x7f2e35bea7d8), requires&lowbar;capability(0x7f2e1e8ab478)&rsqb;&rsqb;
xref:Mutex.adoc[Mutex]&
xref:MaybeCheckNotHeld-07.adoc[MaybeCheckNotHeld](xref:Mutex.adoc[Mutex]& cs);
----

[.small]#xref:MaybeCheckNotHeld-07.adoc[_» more&period;&period;&period;_]#

Require negative capability on a Mutex before locking it and pass it through&period;


[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
&lsqb;&lsqb;requires&lowbar;capability(0x7f2e1892a6b0), lock&lowbar;returned(cs), requires&lowbar;capability(0x7f2e18c10a10), requires&lowbar;capability(0x7f2e324d9de0), requires&lowbar;capability(0x7f2e40253b90), requires&lowbar;capability(0x7f2e36f54270), requires&lowbar;capability(0x7f2e2a2ff1f0), requires&lowbar;capability(0x7f2e37b272e0), requires&lowbar;capability(0x7f2e301235d0), requires&lowbar;capability(0x7f2e3b4d4bd0), requires&lowbar;capability(0x7f2e22086900), requires&lowbar;capability(0x7f2e25f33680), requires&lowbar;capability(0x7f2e42e813d0), requires&lowbar;capability(0x7f2e3ba27e50), requires&lowbar;capability(0x7f2e31c471e0), requires&lowbar;capability(0x7f2e225a2f50), requires&lowbar;capability(0x7f2e32364f30), requires&lowbar;capability(0x7f2e36235ea0), requires&lowbar;capability(0x7f2e23dd7540), requires&lowbar;capability(0x7f2e1c707440), requires&lowbar;capability(0x7f2e21ec9730), requires&lowbar;capability(0x7f2e3043fc70), requires&lowbar;capability(0x7f2e36bf3ab0), requires&lowbar;capability(0x7f2e33a4ccd0), requires&lowbar;capability(0x7f2e2253a930), requires&lowbar;capability(0x7f2e1bc29db0), requires&lowbar;capability(0x7f2e29c6b470), requires&lowbar;capability(0x7f2e19a5bdb0), requires&lowbar;capability(0x7f2e146d5f80), requires&lowbar;capability(0x7f2e41a6d370), requires&lowbar;capability(0x7f2e36f4c850), requires&lowbar;capability(0x7f2e1be61860), requires&lowbar;capability(0x7f2e30e44bf0), requires&lowbar;capability(0x7f2e29cd30b0), requires&lowbar;capability(0x7f2e3aa8ffe0), requires&lowbar;capability(0x7f2e43f23440), requires&lowbar;capability(0x7f2e30e1ad00), requires&lowbar;capability(0x7f2e232117c0), requires&lowbar;capability(0x7f2e362de210), requires&lowbar;capability(0x7f2e1419f230), requires&lowbar;capability(0x7f2e357b9b50), requires&lowbar;capability(0x7f2e188a2770), requires&lowbar;capability(0x7f2e24905230), requires&lowbar;capability(0x7f2e28580c80), requires&lowbar;capability(0x7f2e3ad5b4b0), requires&lowbar;capability(0x7f2e3376be70), requires&lowbar;capability(0x7f2e370f16b0), requires&lowbar;capability(0x7f2e30c0bb50), requires&lowbar;capability(0x7f2e2a6b2370), requires&lowbar;capability(0x7f2e0800ddc0), requires&lowbar;capability(0x7f2e3ab4e330), requires&lowbar;capability(0x7f2e26d300a0), requires&lowbar;capability(0x7f2e1d2c98a0), requires&lowbar;capability(0x7f2e08465780), requires&lowbar;capability(0x7f2e1c59c490), requires&lowbar;capability(0x7f2e38a11140), requires&lowbar;capability(0x7f2e14063aa0), requires&lowbar;capability(0x7f2e19762470), requires&lowbar;capability(0x7f2e2ab62cc0), requires&lowbar;capability(0x7f2e42e843c0), requires&lowbar;capability(0x7f2e241846a0), requires&lowbar;capability(0x7f2e3a6c8430), requires&lowbar;capability(0x7f2e11f18b20), requires&lowbar;capability(0x7f2e1446dd10), requires&lowbar;capability(0x7f2e19a7aaf0), requires&lowbar;capability(0x7f2e297bbbb0), requires&lowbar;capability(0x7f2e31e49710), requires&lowbar;capability(0x7f2e395e2470), requires&lowbar;capability(0x7f2e403c8520), requires&lowbar;capability(0x7f2e31040af0), requires&lowbar;capability(0x7f2e22234190), requires&lowbar;capability(0x7f2e1b67a290), requires&lowbar;capability(0x7f2e33028660), requires&lowbar;capability(0x7f2e36fe5810), requires&lowbar;capability(0x7f2e3840c000), requires&lowbar;capability(0x7f2e2392a490), requires&lowbar;capability(0x7f2e28ce5440), requires&lowbar;capability(0x7f2e312688d0), requires&lowbar;capability(0x7f2e35beacc0), requires&lowbar;capability(0x7f2e1e8ab960)&rsqb;&rsqb;
xref:Mutex.adoc[Mutex]*
xref:MaybeCheckNotHeld-0a.adoc[MaybeCheckNotHeld](xref:Mutex.adoc[Mutex]* cs);
----

[.small]#xref:MaybeCheckNotHeld-0a.adoc[_» more&period;&period;&period;_]#

Check a GlobalMutex or RecursiveMutex is not held in scope and pass it through&period;


[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
template&lt;typename MutexType&gt;
&lsqb;&lsqb;locks&lowbar;excluded(0x7f2e1892ab98), lock&lowbar;returned(m), locks&lowbar;excluded(0x7f2e18c10ef8), locks&lowbar;excluded(0x7f2e324da2c8), locks&lowbar;excluded(0x7f2e40254078), locks&lowbar;excluded(0x7f2e36f54758), locks&lowbar;excluded(0x7f2e2a2ff6d8), locks&lowbar;excluded(0x7f2e37b277c8), locks&lowbar;excluded(0x7f2e30123ab8), locks&lowbar;excluded(0x7f2e3b4d50b8), locks&lowbar;excluded(0x7f2e22086de8), locks&lowbar;excluded(0x7f2e25f33b68), locks&lowbar;excluded(0x7f2e42e818b8), locks&lowbar;excluded(0x7f2e3ba28338), locks&lowbar;excluded(0x7f2e31c476c8), locks&lowbar;excluded(0x7f2e225a3438), locks&lowbar;excluded(0x7f2e2472ad18), locks&lowbar;excluded(0x7f2e36236388), locks&lowbar;excluded(0x7f2e23dd7a28), locks&lowbar;excluded(0x7f2e1c707928), locks&lowbar;excluded(0x7f2e21ec9c18), locks&lowbar;excluded(0x7f2e30440158), locks&lowbar;excluded(0x7f2e36bf3f98), locks&lowbar;excluded(0x7f2e33a4d1b8), locks&lowbar;excluded(0x7f2e2253ae18), locks&lowbar;excluded(0x7f2e1bc2a298), locks&lowbar;excluded(0x7f2e29c6b958), locks&lowbar;excluded(0x7f2e19a5c298), locks&lowbar;excluded(0x7f2e146d6468), locks&lowbar;excluded(0x7f2e41a6d858), locks&lowbar;excluded(0x7f2e36f4cd38), locks&lowbar;excluded(0x7f2e1be61d48), locks&lowbar;excluded(0x7f2e30e450d8), locks&lowbar;excluded(0x7f2e29cd3598), locks&lowbar;excluded(0x7f2e3aa904c8), locks&lowbar;excluded(0x7f2e43f23928), locks&lowbar;excluded(0x7f2e30e1b1e8), locks&lowbar;excluded(0x7f2e23211ca8), locks&lowbar;excluded(0x7f2e362de6f8), locks&lowbar;excluded(0x7f2e1419f718), locks&lowbar;excluded(0x7f2e357ba038), locks&lowbar;excluded(0x7f2e188a2c58), locks&lowbar;excluded(0x7f2e24905718), locks&lowbar;excluded(0x7f2e28581168), locks&lowbar;excluded(0x7f2e3ad5b998), locks&lowbar;excluded(0x7f2e3376c358), locks&lowbar;excluded(0x7f2e370f1b98), locks&lowbar;excluded(0x7f2e30c0c038), locks&lowbar;excluded(0x7f2e2a6b2858), locks&lowbar;excluded(0x7f2e0800e2a8), locks&lowbar;excluded(0x7f2e3ab4e818), locks&lowbar;excluded(0x7f2e26d30588), locks&lowbar;excluded(0x7f2e1d2c9d88), locks&lowbar;excluded(0x7f2e08465c68), locks&lowbar;excluded(0x7f2e1c59c978), locks&lowbar;excluded(0x7f2e38a11628), locks&lowbar;excluded(0x7f2e14063f88), locks&lowbar;excluded(0x7f2e19762958), locks&lowbar;excluded(0x7f2e2ab631a8), locks&lowbar;excluded(0x7f2e42e848a8), locks&lowbar;excluded(0x7f2e24184b88), locks&lowbar;excluded(0x7f2e3a6c8918), locks&lowbar;excluded(0x7f2e11f19008), locks&lowbar;excluded(0x7f2e1446e1f8), locks&lowbar;excluded(0x7f2e19a7afd8), locks&lowbar;excluded(0x7f2e297bc098), locks&lowbar;excluded(0x7f2e31e49bf8), locks&lowbar;excluded(0x7f2e395e2958), locks&lowbar;excluded(0x7f2e403c8a08), locks&lowbar;excluded(0x7f2e31040fd8), locks&lowbar;excluded(0x7f2e22234678), locks&lowbar;excluded(0x7f2e1b67a778), locks&lowbar;excluded(0x7f2e33028b48), locks&lowbar;excluded(0x7f2e36fe5cf8), locks&lowbar;excluded(0x7f2e3840c4e8), locks&lowbar;excluded(0x7f2e2392a978), locks&lowbar;excluded(0x7f2e28ce5928), locks&lowbar;excluded(0x7f2e31268db8), locks&lowbar;excluded(0x7f2e35beb1a8), locks&lowbar;excluded(0x7f2e1e8abe48)&rsqb;&rsqb;
MutexType&
xref:MaybeCheckNotHeld-0b.adoc[MaybeCheckNotHeld](MutexType& m);
----

[.small]#xref:MaybeCheckNotHeld-0b.adoc[_» more&period;&period;&period;_]#

Check a GlobalMutex or RecursiveMutex is not held in scope and pass it through&period;


[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
template&lt;typename MutexType&gt;
&lsqb;&lsqb;locks&lowbar;excluded(0x7f2e1892b088), lock&lowbar;returned(m), locks&lowbar;excluded(0x7f2e18c113e8), locks&lowbar;excluded(0x7f2e324da7b8), locks&lowbar;excluded(0x7f2e40254568), locks&lowbar;excluded(0x7f2e36f54c48), locks&lowbar;excluded(0x7f2e2a2ffbc8), locks&lowbar;excluded(0x7f2e37b27cb8), locks&lowbar;excluded(0x7f2e30123fa8), locks&lowbar;excluded(0x7f2e3b4d55a8), locks&lowbar;excluded(0x7f2e220872d8), locks&lowbar;excluded(0x7f2e25f34058), locks&lowbar;excluded(0x7f2e42e81da8), locks&lowbar;excluded(0x7f2e3ba28828), locks&lowbar;excluded(0x7f2e31c47bb8), locks&lowbar;excluded(0x7f2e225a3928), locks&lowbar;excluded(0x7f2e2472b208), locks&lowbar;excluded(0x7f2e36236878), locks&lowbar;excluded(0x7f2e23dd7f18), locks&lowbar;excluded(0x7f2e1c707e18), locks&lowbar;excluded(0x7f2e21eca108), locks&lowbar;excluded(0x7f2e30440648), locks&lowbar;excluded(0x7f2e36bf4488), locks&lowbar;excluded(0x7f2e33a4d6a8), locks&lowbar;excluded(0x7f2e2253b308), locks&lowbar;excluded(0x7f2e1bc2a788), locks&lowbar;excluded(0x7f2e29c6be48), locks&lowbar;excluded(0x7f2e19a5c788), locks&lowbar;excluded(0x7f2e146d6958), locks&lowbar;excluded(0x7f2e41a6dd48), locks&lowbar;excluded(0x7f2e36f4d228), locks&lowbar;excluded(0x7f2e1be62238), locks&lowbar;excluded(0x7f2e30e455c8), locks&lowbar;excluded(0x7f2e29cd3a88), locks&lowbar;excluded(0x7f2e3aa909b8), locks&lowbar;excluded(0x7f2e43f23e18), locks&lowbar;excluded(0x7f2e30e1b6d8), locks&lowbar;excluded(0x7f2e23212198), locks&lowbar;excluded(0x7f2e362debe8), locks&lowbar;excluded(0x7f2e1419fc08), locks&lowbar;excluded(0x7f2e357ba528), locks&lowbar;excluded(0x7f2e188a3148), locks&lowbar;excluded(0x7f2e24905c08), locks&lowbar;excluded(0x7f2e28581658), locks&lowbar;excluded(0x7f2e3ad5be88), locks&lowbar;excluded(0x7f2e3376c848), locks&lowbar;excluded(0x7f2e370f2088), locks&lowbar;excluded(0x7f2e30c0c528), locks&lowbar;excluded(0x7f2e2a6b2d48), locks&lowbar;excluded(0x7f2e0800e798), locks&lowbar;excluded(0x7f2e3ab4ed08), locks&lowbar;excluded(0x7f2e26d30a78), locks&lowbar;excluded(0x7f2e1d2ca278), locks&lowbar;excluded(0x7f2e08466158), locks&lowbar;excluded(0x7f2e1c59ce68), locks&lowbar;excluded(0x7f2e38a11b18), locks&lowbar;excluded(0x7f2e14064478), locks&lowbar;excluded(0x7f2e19762e48), locks&lowbar;excluded(0x7f2e2ab63698), locks&lowbar;excluded(0x7f2e42e84d98), locks&lowbar;excluded(0x7f2e24185078), locks&lowbar;excluded(0x7f2e3a6c8e08), locks&lowbar;excluded(0x7f2e11f194f8), locks&lowbar;excluded(0x7f2e1446e6e8), locks&lowbar;excluded(0x7f2e19a7b4c8), locks&lowbar;excluded(0x7f2e297bc588), locks&lowbar;excluded(0x7f2e31e4a0e8), locks&lowbar;excluded(0x7f2e395e2e48), locks&lowbar;excluded(0x7f2e403c8ef8), locks&lowbar;excluded(0x7f2e310414c8), locks&lowbar;excluded(0x7f2e22234b68), locks&lowbar;excluded(0x7f2e1b67ac68), locks&lowbar;excluded(0x7f2e33029038), locks&lowbar;excluded(0x7f2e36fe61e8), locks&lowbar;excluded(0x7f2e3840c9d8), locks&lowbar;excluded(0x7f2e2392ae68), locks&lowbar;excluded(0x7f2e28ce5e18), locks&lowbar;excluded(0x7f2e312692a8), locks&lowbar;excluded(0x7f2e35beb698), locks&lowbar;excluded(0x7f2e1e8ac338)&rsqb;&rsqb;
MutexType*
xref:MaybeCheckNotHeld-01.adoc[MaybeCheckNotHeld](MutexType* m);
----

[.small]#xref:MaybeCheckNotHeld-01.adoc[_» more&period;&period;&period;_]#

== Return Value

* The same mutex reference&period;
* The same mutex pointer&period;

== Parameters

[cols="1,4"]
|===
| Name| Description
| *cs*
| Mutex about to be locked&period;
| *m*
| Mutex about to be locked&period;
|===


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