[PATCH] [llvm] Change llvm::sys::Mutex implementation to use STL-provided mutexes
Zachary Turner
zturner at google.com
Thu May 29 14:02:26 PDT 2014
Fix compiler errors on linux.
http://reviews.llvm.org/D3960
Files:
lib/ExecutionEngine/OProfileJIT/OProfileWrapper.cpp
lib/Support/Unix/Process.inc
lib/Support/Unix/Signals.inc
Index: lib/ExecutionEngine/OProfileJIT/OProfileWrapper.cpp
===================================================================
--- lib/ExecutionEngine/OProfileJIT/OProfileWrapper.cpp
+++ lib/ExecutionEngine/OProfileJIT/OProfileWrapper.cpp
@@ -33,7 +33,7 @@
namespace {
// Global mutex to ensure a single thread initializes oprofile agent.
-llvm::sys::Mutex OProfileInitializationMutex;
+llvm::sys::RecursiveMutex OProfileInitializationMutex;
} // anonymous namespace
Index: lib/Support/Unix/Process.inc
===================================================================
--- lib/Support/Unix/Process.inc
+++ lib/Support/Unix/Process.inc
@@ -266,7 +266,7 @@
static bool terminalHasColors(int fd) {
#ifdef HAVE_TERMINFO
// First, acquire a global lock because these C routines are thread hostile.
- static sys::Mutex M;
+ static sys::RecursiveMutex M;
MutexGuard G(M);
int errret = 0;
Index: lib/Support/Unix/Signals.inc
===================================================================
--- lib/Support/Unix/Signals.inc
+++ lib/Support/Unix/Signals.inc
@@ -41,7 +41,7 @@
static RETSIGTYPE SignalHandler(int Sig); // defined below.
-static SmartMutex<true> SignalsMutex;
+static llvm::sys::RecursiveDebugMutex SignalsMutex;
/// InterruptFunction - The function to call if ctrl-c is pressed.
static void (*InterruptFunction)() = nullptr;
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D3960.9932.patch
Type: text/x-patch
Size: 1370 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20140529/29caeafe/attachment.bin>
More information about the llvm-commits
mailing list