mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-07-25 13:24:46 +00:00
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 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@211277 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -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;
|
||||
}
|
||||
|
Reference in New Issue
Block a user