diff options
author | Saleem Abdulrasool <compnerd@compnerd.org> | 2016-05-18 01:59:10 +0000 |
---|---|---|
committer | Saleem Abdulrasool <compnerd@compnerd.org> | 2016-05-18 01:59:10 +0000 |
commit | 16ff8604690ea63a3a82dd3b156061afb84dbcf1 (patch) | |
tree | a2d912258ecb0690f4a810ca1e438fc277160326 /lldb/source/Utility/SharingPtr.cpp | |
parent | a36a61d46ac3f2ea10e78ac816bca5784bc8ba35 (diff) | |
download | bcm5719-llvm-16ff8604690ea63a3a82dd3b156061afb84dbcf1.tar.gz bcm5719-llvm-16ff8604690ea63a3a82dd3b156061afb84dbcf1.zip |
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
Diffstat (limited to 'lldb/source/Utility/SharingPtr.cpp')
-rw-r--r-- | lldb/source/Utility/SharingPtr.cpp | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/lldb/source/Utility/SharingPtr.cpp b/lldb/source/Utility/SharingPtr.cpp index 7f1278567ff..7eedeb08afd 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 @@ extern "C" void track_sp (void *sp_this, void *ptr, long use_count) { 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) |