summaryrefslogtreecommitdiffstats
path: root/lldb/source/Host/common/NativeBreakpointList.cpp
diff options
context:
space:
mode:
authorSaleem Abdulrasool <compnerd@compnerd.org>2016-05-18 01:59:10 +0000
committerSaleem Abdulrasool <compnerd@compnerd.org>2016-05-18 01:59:10 +0000
commit16ff8604690ea63a3a82dd3b156061afb84dbcf1 (patch)
treea2d912258ecb0690f4a810ca1e438fc277160326 /lldb/source/Host/common/NativeBreakpointList.cpp
parenta36a61d46ac3f2ea10e78ac816bca5784bc8ba35 (diff)
downloadbcm5719-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/Host/common/NativeBreakpointList.cpp')
-rw-r--r--lldb/source/Host/common/NativeBreakpointList.cpp13
1 files changed, 6 insertions, 7 deletions
diff --git a/lldb/source/Host/common/NativeBreakpointList.cpp b/lldb/source/Host/common/NativeBreakpointList.cpp
index 52b9baf5f53..67873a06dd2 100644
--- a/lldb/source/Host/common/NativeBreakpointList.cpp
+++ b/lldb/source/Host/common/NativeBreakpointList.cpp
@@ -17,8 +17,7 @@
using namespace lldb;
using namespace lldb_private;
-NativeBreakpointList::NativeBreakpointList () :
- m_mutex (Mutex::eMutexTypeRecursive)
+NativeBreakpointList::NativeBreakpointList() : m_mutex()
{
}
@@ -29,7 +28,7 @@ NativeBreakpointList::AddRef (lldb::addr_t addr, size_t size_hint, bool hardware
if (log)
log->Printf ("NativeBreakpointList::%s addr = 0x%" PRIx64 ", size_hint = %lu, hardware = %s", __FUNCTION__, addr, size_hint, hardware ? "true" : "false");
- Mutex::Locker locker (m_mutex);
+ std::lock_guard<std::recursive_mutex> guard(m_mutex);
// Check if the breakpoint is already set.
auto iter = m_breakpoints.find (addr);
@@ -72,7 +71,7 @@ NativeBreakpointList::DecRef (lldb::addr_t addr)
if (log)
log->Printf ("NativeBreakpointList::%s addr = 0x%" PRIx64, __FUNCTION__, addr);
- Mutex::Locker locker (m_mutex);
+ std::lock_guard<std::recursive_mutex> guard(m_mutex);
// Check if the breakpoint is already set.
auto iter = m_breakpoints.find (addr);
@@ -136,7 +135,7 @@ NativeBreakpointList::EnableBreakpoint (lldb::addr_t addr)
if (log)
log->Printf ("NativeBreakpointList::%s addr = 0x%" PRIx64, __FUNCTION__, addr);
- Mutex::Locker locker (m_mutex);
+ std::lock_guard<std::recursive_mutex> guard(m_mutex);
// Ensure we have said breakpoint.
auto iter = m_breakpoints.find (addr);
@@ -159,7 +158,7 @@ NativeBreakpointList::DisableBreakpoint (lldb::addr_t addr)
if (log)
log->Printf ("NativeBreakpointList::%s addr = 0x%" PRIx64, __FUNCTION__, addr);
- Mutex::Locker locker (m_mutex);
+ std::lock_guard<std::recursive_mutex> guard(m_mutex);
// Ensure we have said breakpoint.
auto iter = m_breakpoints.find (addr);
@@ -182,7 +181,7 @@ NativeBreakpointList::GetBreakpoint (lldb::addr_t addr, NativeBreakpointSP &brea
if (log)
log->Printf ("NativeBreakpointList::%s addr = 0x%" PRIx64, __FUNCTION__, addr);
- Mutex::Locker locker (m_mutex);
+ std::lock_guard<std::recursive_mutex> guard(m_mutex);
// Ensure we have said breakpoint.
auto iter = m_breakpoints.find (addr);
OpenPOWER on IntegriCloud