diff --git a/llvm/lib/Support/CrashRecoveryContext.cpp b/llvm/lib/Support/CrashRecoveryContext.cpp --- a/llvm/lib/Support/CrashRecoveryContext.cpp +++ b/llvm/lib/Support/CrashRecoveryContext.cpp @@ -84,8 +84,7 @@ }; } // namespace -static ManagedStatic gCrashRecoveryContextMutex; -static bool gCrashRecoveryEnabled = false; +static LLVM_THREAD_LOCAL bool gCrashRecoveryEnabled = false; static ManagedStatic> tlIsRecoveringFromCrash; @@ -136,8 +135,6 @@ } 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::Disable() { - std::lock_guard L(*gCrashRecoveryContextMutex); if (!gCrashRecoveryEnabled) return; gCrashRecoveryEnabled = false;