remove use of Mutex in favour of std::{,recursive_}mutex
This is a pretty straightforward first pass over removing a number of uses of
Mutex in favor of std::mutex or std::recursive_mutex. The problem is that there
are interfaces which take Mutex::Locker & to lock internal locks. This patch
cleans up most of the easy cases. The only non-trivial change is in
CommandObjectTarget.cpp where a Mutex::Locker was split into two.
llvm-svn: 269877
diff --git a/lldb/source/Utility/SharingPtr.cpp b/lldb/source/Utility/SharingPtr.cpp
index 7f12785..7eedeb0 100644
--- a/lldb/source/Utility/SharingPtr.cpp
+++ b/lldb/source/Utility/SharingPtr.cpp
@@ -14,12 +14,12 @@
// If ENABLE_SP_LOGGING is defined, then log all shared pointer assignments
// and allow them to be queried using a pointer by a call to:
#include <execinfo.h>
-#include <map>
#include <assert.h>
-#include "lldb/Host/Mutex.h"
#include "llvm/ADT/STLExtras.h"
+#include <map>
+#include <mutex>
#include <vector>
class Backtrace
@@ -70,8 +70,8 @@
{
typedef std::pair<void *, Backtrace> PtrBacktracePair;
typedef std::map<void *, PtrBacktracePair> PtrToBacktraceMap;
- static lldb_private::Mutex g_mutex(lldb_private::Mutex::eMutexTypeNormal);
- lldb_private::Mutex::Locker locker (g_mutex);
+ static std::mutex g_mutex;
+ std::lock_guard<std::mutex> guard(g_mutex);
static PtrToBacktraceMap g_map;
if (sp_this)