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/Core/Log.cpp b/lldb/source/Core/Log.cpp
index 9a356e6..a292df3 100644
--- a/lldb/source/Core/Log.cpp
+++ b/lldb/source/Core/Log.cpp
@@ -9,10 +9,11 @@
// C Includes
// C++ Includes
-#include <cstdio>
#include <cstdarg>
+#include <cstdio>
#include <cstdlib>
#include <map>
+#include <mutex>
#include <string>
// Other libraries and framework includes
@@ -26,7 +27,6 @@
#include "lldb/Core/StreamFile.h"
#include "lldb/Core/StreamString.h"
#include "lldb/Host/Host.h"
-#include "lldb/Host/Mutex.h"
#include "lldb/Host/ThisThread.h"
#include "lldb/Host/TimeValue.h"
#include "lldb/Interpreter/Args.h"
@@ -147,8 +147,8 @@
if (m_options.Test(LLDB_LOG_OPTION_THREADSAFE))
{
- static Mutex g_LogThreadedMutex(Mutex::eMutexTypeRecursive);
- Mutex::Locker locker(g_LogThreadedMutex);
+ static std::recursive_mutex g_LogThreadedMutex;
+ std::lock_guard<std::recursive_mutex> guard(g_LogThreadedMutex);
stream_sp->PutCString(header.GetString().c_str());
stream_sp->Flush();
}