diff options
author | Benjamin Kramer <benny.kra@googlemail.com> | 2019-08-19 19:49:57 +0000 |
---|---|---|
committer | Benjamin Kramer <benny.kra@googlemail.com> | 2019-08-19 19:49:57 +0000 |
commit | 928071ae4ef5e2e6342afb126518a79fde81cf8b (patch) | |
tree | 3553e54db7f1bc27ba0585fe6cef1efbd8a7b9c4 /llvm/lib/Support/CrashRecoveryContext.cpp | |
parent | 056f1b5cc7c2133f0cb3e30e7f24808d321096d7 (diff) | |
download | bcm5719-llvm-928071ae4ef5e2e6342afb126518a79fde81cf8b.tar.gz bcm5719-llvm-928071ae4ef5e2e6342afb126518a79fde81cf8b.zip |
[Support] Replace sys::Mutex with their standard equivalents.
Only use a recursive mutex if it can be locked recursively.
llvm-svn: 369295
Diffstat (limited to 'llvm/lib/Support/CrashRecoveryContext.cpp')
-rw-r--r-- | llvm/lib/Support/CrashRecoveryContext.cpp | 8 |
1 files changed, 4 insertions, 4 deletions
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 <mutex> #include <setjmp.h> using namespace llvm; @@ -71,7 +71,7 @@ public: } -static ManagedStatic<sys::Mutex> gCrashRecoveryContextMutex; +static ManagedStatic<std::mutex> gCrashRecoveryContextMutex; static bool gCrashRecoveryEnabled = false; static ManagedStatic<sys::ThreadLocal<const CrashRecoveryContext>> @@ -116,7 +116,7 @@ CrashRecoveryContext *CrashRecoveryContext::GetCurrent() { } void CrashRecoveryContext::Enable() { - sys::ScopedLock L(*gCrashRecoveryContextMutex); + std::lock_guard<std::mutex> 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<std::mutex> L(*gCrashRecoveryContextMutex); if (!gCrashRecoveryEnabled) return; gCrashRecoveryEnabled = false; |