mirror of
https://github.com/capstone-engine/llvm-capstone.git
synced 2025-01-19 06:38:28 +00:00
Revert "Make gCrashRecoveryEnabled thread local"
This reverts commit 5e77ea04f214c7a18bd5c782c8b8a7b7c828ad7a. Causes a breakage on Windows buildbot.
This commit is contained in:
parent
606c3be85d
commit
d650365935
@ -84,7 +84,8 @@ public:
|
||||
};
|
||||
} // namespace
|
||||
|
||||
static LLVM_THREAD_LOCAL bool gCrashRecoveryEnabled = false;
|
||||
static ManagedStatic<std::mutex> gCrashRecoveryContextMutex;
|
||||
static bool gCrashRecoveryEnabled = false;
|
||||
|
||||
static ManagedStatic<sys::ThreadLocal<const CrashRecoveryContext>>
|
||||
tlIsRecoveringFromCrash;
|
||||
@ -135,6 +136,8 @@ CrashRecoveryContext *CrashRecoveryContext::GetCurrent() {
|
||||
}
|
||||
|
||||
void CrashRecoveryContext::Enable() {
|
||||
std::lock_guard<std::mutex> L(*gCrashRecoveryContextMutex);
|
||||
// FIXME: Shouldn't this be a refcount or something?
|
||||
if (gCrashRecoveryEnabled)
|
||||
return;
|
||||
gCrashRecoveryEnabled = true;
|
||||
@ -142,6 +145,7 @@ void CrashRecoveryContext::Enable() {
|
||||
}
|
||||
|
||||
void CrashRecoveryContext::Disable() {
|
||||
std::lock_guard<std::mutex> L(*gCrashRecoveryContextMutex);
|
||||
if (!gCrashRecoveryEnabled)
|
||||
return;
|
||||
gCrashRecoveryEnabled = false;
|
||||
|
Loading…
x
Reference in New Issue
Block a user