[lld] r226236 - Use std::recursive_mutex instead of llvm's SmartMutex.

Rui Ueyama ruiu at google.com
Thu Jan 15 16:55:02 PST 2015


Author: ruiu
Date: Thu Jan 15 18:55:01 2015
New Revision: 226236

URL: http://llvm.org/viewvc/llvm-project?rev=226236&view=rev
Log:
Use std::recursive_mutex instead of llvm's SmartMutex.

Modified:
    lld/trunk/lib/Core/Error.cpp

Modified: lld/trunk/lib/Core/Error.cpp
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/lib/Core/Error.cpp?rev=226236&r1=226235&r2=226236&view=diff
==============================================================================
--- lld/trunk/lib/Core/Error.cpp (original)
+++ lld/trunk/lib/Core/Error.cpp Thu Jan 15 18:55:01 2015
@@ -10,7 +10,7 @@
 #include "lld/Core/Error.h"
 #include "llvm/ADT/Twine.h"
 #include "llvm/Support/ErrorHandling.h"
-#include "llvm/Support/Mutex.h"
+#include <mutex>
 #include <string>
 #include <vector>
 
@@ -117,9 +117,9 @@ public:
     // The value is an index into the string vector.
     return _messages[ev];
   }
-  
+
   int add(std::string msg) {
-    llvm::sys::SmartScopedLock<true> lock(_mutex);
+    std::lock_guard<std::recursive_mutex> lock(_mutex);
     // Value zero is always the successs value.
     if (_messages.empty())
       _messages.push_back("Success");
@@ -127,10 +127,10 @@ public:
     // Return the index of the string just appended.
     return _messages.size() - 1;
   }
-  
+
 private:
   std::vector<std::string> _messages;
-  llvm::sys::SmartMutex<true> _mutex;
+  std::recursive_mutex _mutex;
 };
 
 static dynamic_error_category categorySingleton;
@@ -144,4 +144,3 @@ std::error_code make_dynamic_error_code(
 }
 
 }
-





More information about the llvm-commits mailing list