From 928071ae4ef5e2e6342afb126518a79fde81cf8b Mon Sep 17 00:00:00 2001 From: Benjamin Kramer Date: Mon, 19 Aug 2019 19:49:57 +0000 Subject: [Support] Replace sys::Mutex with their standard equivalents. Only use a recursive mutex if it can be locked recursively. llvm-svn: 369295 --- llvm/lib/Support/CrashRecoveryContext.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'llvm/lib/Support/CrashRecoveryContext.cpp') diff --git a/llvm/lib/Support/CrashRecoveryContext.cpp b/llvm/lib/Support/CrashRecoveryContext.cpp index c2459256f8f..9d13fce9cc5 100644 --- a/llvm/lib/Support/CrashRecoveryContext.cpp +++ b/llvm/lib/Support/CrashRecoveryContext.cpp @@ -10,8 +10,8 @@ #include "llvm/Config/llvm-config.h" #include "llvm/Support/ErrorHandling.h" #include "llvm/Support/ManagedStatic.h" -#include "llvm/Support/Mutex.h" #include "llvm/Support/ThreadLocal.h" +#include #include using namespace llvm; @@ -71,7 +71,7 @@ public: } -static ManagedStatic gCrashRecoveryContextMutex; +static ManagedStatic gCrashRecoveryContextMutex; static bool gCrashRecoveryEnabled = false; static ManagedStatic> @@ -116,7 +116,7 @@ CrashRecoveryContext *CrashRecoveryContext::GetCurrent() { } void CrashRecoveryContext::Enable() { - sys::ScopedLock L(*gCrashRecoveryContextMutex); + std::lock_guard L(*gCrashRecoveryContextMutex); // FIXME: Shouldn't this be a refcount or something? if (gCrashRecoveryEnabled) return; @@ -125,7 +125,7 @@ void CrashRecoveryContext::Enable() { } void CrashRecoveryContext::Disable() { - sys::ScopedLock L(*gCrashRecoveryContextMutex); + std::lock_guard L(*gCrashRecoveryContextMutex); if (!gCrashRecoveryEnabled) return; gCrashRecoveryEnabled = false; -- cgit v1.2.3