summaryrefslogtreecommitdiffstats
path: root/lld/lib/Core/Error.cpp
diff options
context:
space:
mode:
authorRui Ueyama <ruiu@google.com>2015-01-16 00:55:01 +0000
committerRui Ueyama <ruiu@google.com>2015-01-16 00:55:01 +0000
commit18e53ca3dd5a3caccca85d96a5b4dc1667e712dd (patch)
tree41603746d4fec964d54b1db2fc17b7e189e01e78 /lld/lib/Core/Error.cpp
parent1fc244144706498cdf88cdfb87d7ca9f54bf85f4 (diff)
downloadbcm5719-llvm-18e53ca3dd5a3caccca85d96a5b4dc1667e712dd.tar.gz
bcm5719-llvm-18e53ca3dd5a3caccca85d96a5b4dc1667e712dd.zip
Use std::recursive_mutex instead of llvm's SmartMutex.
llvm-svn: 226236
Diffstat (limited to 'lld/lib/Core/Error.cpp')
-rw-r--r--lld/lib/Core/Error.cpp11
1 files changed, 5 insertions, 6 deletions
diff --git a/lld/lib/Core/Error.cpp b/lld/lib/Core/Error.cpp
index 9dbb1a4d17b..2e7918972b6 100644
--- a/lld/lib/Core/Error.cpp
+++ b/lld/lib/Core/Error.cpp
@@ -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(const Twine &msg) {
}
}
-
OpenPOWER on IntegriCloud