[#GlobalMutex]
= GlobalMutex
:mrdocs:

Different type to mark Mutex at global scope

== Synopsis

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

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
class GlobalMutex
    : public xref:Mutex.adoc[Mutex]
----

== Description

Thread safety analysis can&apos;t handle negative assertions about mutexes with global scope well, so mark them with a separate type, and eventually move all the mutexes into classes so they are not globally visible&period;

See&colon; https&colon;&sol;&sol;github&period;com&sol;bitcoin&sol;bitcoin&sol;pull&sol;20272&num;issuecomment&hyphen;720755781

== Base Classes

[cols="1,4"]
|===
| Name| Description
| `xref:Mutex.adoc[Mutex]`
| Wrapped mutex&colon; supports waiting but not recursive locking
|===


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