diff --git a/llvm/lib/Support/CrashRecoveryContext.cpp b/llvm/lib/Support/CrashRecoveryContext.cpp index 3ee6a4fd36f40..64f8b3699ed70 100644 --- a/llvm/lib/Support/CrashRecoveryContext.cpp +++ b/llvm/lib/Support/CrashRecoveryContext.cpp @@ -84,8 +84,7 @@ struct CrashRecoveryContextImpl { }; } // namespace -static ManagedStatic gCrashRecoveryContextMutex; -static bool gCrashRecoveryEnabled = false; +static LLVM_THREAD_LOCAL bool gCrashRecoveryEnabled = false; static ManagedStatic> tlIsRecoveringFromCrash; @@ -136,8 +135,6 @@ CrashRecoveryContext *CrashRecoveryContext::GetCurrent() { } void CrashRecoveryContext::Enable() { - std::lock_guard L(*gCrashRecoveryContextMutex); - // FIXME: Shouldn't this be a refcount or something? if (gCrashRecoveryEnabled) return; gCrashRecoveryEnabled = true; @@ -145,7 +142,6 @@ void CrashRecoveryContext::Enable() { } void CrashRecoveryContext::Disable() { - std::lock_guard L(*gCrashRecoveryContextMutex); if (!gCrashRecoveryEnabled) return; gCrashRecoveryEnabled = false;