diff --git a/xpcom/build/XPCOMInit.cpp b/xpcom/build/XPCOMInit.cpp index 9fd9fb255e41..fbee0bef7434 100644 --- a/xpcom/build/XPCOMInit.cpp +++ b/xpcom/build/XPCOMInit.cpp @@ -148,7 +148,8 @@ nsresult nsLocalFileConstructor(nsISupports* aOuter, const nsIID& aIID, nsComponentManagerImpl* nsComponentManagerImpl::gComponentManager = nullptr; bool gXPCOMShuttingDown = false; -bool gXPCOMThreadsShutDown = false; +mozilla::Atomic gXPCOMThreadsShutDown( + false); bool gXPCOMMainThreadEventsAreDoomed = false; char16_t* gGREBinPath = nullptr; diff --git a/xpcom/build/nsXPCOM.h b/xpcom/build/nsXPCOM.h index 159cacc84c31..5ff61268d910 100644 --- a/xpcom/build/nsXPCOM.h +++ b/xpcom/build/nsXPCOM.h @@ -10,6 +10,7 @@ #include "nscore.h" #include "nsXPCOMCID.h" #include "mozilla/Attributes.h" +#include "mozilla/Atomics.h" #ifdef __cplusplus # define DECL_CLASS(c) class c @@ -31,7 +32,8 @@ DECL_CLASS(nsIDebug2); #ifdef __cplusplus extern bool gXPCOMShuttingDown; -extern bool gXPCOMThreadsShutDown; +extern mozilla::Atomic + gXPCOMThreadsShutDown; extern bool gXPCOMMainThreadEventsAreDoomed; #endif