diff options
author | Zachary Turner <zturner@google.com> | 2014-06-19 16:17:42 +0000 |
---|---|---|
committer | Zachary Turner <zturner@google.com> | 2014-06-19 16:17:42 +0000 |
commit | 6ad2444d5bfdeeb75b7cbeb672fc73fce342ec6b (patch) | |
tree | 7e6feeaa1722d230e363647e9852f688e7eae0df /llvm/lib/Support/Timer.cpp | |
parent | c8e3b5f8490d5f196940835100b39a07c79344c4 (diff) | |
download | llvm-6ad2444d5bfdeeb75b7cbeb672fc73fce342ec6b.zip llvm-6ad2444d5bfdeeb75b7cbeb672fc73fce342ec6b.tar.gz llvm-6ad2444d5bfdeeb75b7cbeb672fc73fce342ec6b.tar.bz2 |
Kill the LLVM global lock.
This patch removes the LLVM global lock, and updates all existing
users of the global lock to use their own mutex. None of the
existing users of the global lock were protecting code that was
mutually exclusive with any of the other users of the global
lock, so its purpose was not being met.
Reviewed by: rnk
Differential Revision: http://reviews.llvm.org/D4142
llvm-svn: 211277
Diffstat (limited to 'llvm/lib/Support/Timer.cpp')
-rw-r--r-- | llvm/lib/Support/Timer.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/llvm/lib/Support/Timer.cpp b/llvm/lib/Support/Timer.cpp index 61465ae..210bda7 100644 --- a/llvm/lib/Support/Timer.cpp +++ b/llvm/lib/Support/Timer.cpp @@ -19,6 +19,7 @@ #include "llvm/Support/Format.h" #include "llvm/Support/ManagedStatic.h" #include "llvm/Support/Mutex.h" +#include "llvm/Support/MutexGuard.h" #include "llvm/Support/Process.h" #include "llvm/Support/raw_ostream.h" using namespace llvm; @@ -84,14 +85,13 @@ static TimerGroup *getDefaultTimerGroup() { sys::MemoryFence(); if (tmp) return tmp; - llvm_acquire_global_lock(); + sys::SmartScopedLock<true> Lock(*TimerLock); tmp = DefaultTimerGroup; if (!tmp) { tmp = new TimerGroup("Miscellaneous Ungrouped Timers"); sys::MemoryFence(); DefaultTimerGroup = tmp; } - llvm_release_global_lock(); return tmp; } |