summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKuba Brecka <kuba.brecka@gmail.com>2016-05-22 12:24:38 +0000
committerKuba Brecka <kuba.brecka@gmail.com>2016-05-22 12:24:38 +0000
commit7380f25d2909a9b4a07efe89277e928ee572e9a8 (patch)
treee2b61732127bd19abc3c40f3e5eb92c6ab7c85a7
parent2ba64ab9ae8610f54c5026455eba1fbfd24e0d3d (diff)
downloadbcm5719-llvm-7380f25d2909a9b4a07efe89277e928ee572e9a8.tar.gz
bcm5719-llvm-7380f25d2909a9b4a07efe89277e928ee572e9a8.zip
Fix an incorrectly used locking in HistoryThread and HistoryUnwind, where unique_lock's release() was called causing the mutex to stay locked.
llvm-svn: 270358
-rw-r--r--lldb/source/Plugins/Process/Utility/HistoryThread.cpp3
-rw-r--r--lldb/source/Plugins/Process/Utility/HistoryUnwind.cpp3
2 files changed, 2 insertions, 4 deletions
diff --git a/lldb/source/Plugins/Process/Utility/HistoryThread.cpp b/lldb/source/Plugins/Process/Utility/HistoryThread.cpp
index 20a10106c2a..0f7abc87ece 100644
--- a/lldb/source/Plugins/Process/Utility/HistoryThread.cpp
+++ b/lldb/source/Plugins/Process/Utility/HistoryThread.cpp
@@ -75,8 +75,7 @@ lldb::StackFrameListSP
HistoryThread::GetStackFrameList ()
{
// FIXME do not throw away the lock after we acquire it..
- std::unique_lock<std::mutex> lock(m_framelist_mutex);
- lock.release();
+ std::lock_guard<std::mutex> lock(m_framelist_mutex);
if (m_framelist.get() == NULL)
{
m_framelist.reset (new StackFrameList (*this, StackFrameListSP(), true));
diff --git a/lldb/source/Plugins/Process/Utility/HistoryUnwind.cpp b/lldb/source/Plugins/Process/Utility/HistoryUnwind.cpp
index 62e4bc0a347..4ae324575c0 100644
--- a/lldb/source/Plugins/Process/Utility/HistoryUnwind.cpp
+++ b/lldb/source/Plugins/Process/Utility/HistoryUnwind.cpp
@@ -65,8 +65,7 @@ bool
HistoryUnwind::DoGetFrameInfoAtIndex (uint32_t frame_idx, lldb::addr_t& cfa, lldb::addr_t& pc)
{
// FIXME do not throw away the lock after we acquire it..
- std::unique_lock<std::recursive_mutex> guard(m_unwind_mutex);
- guard.release();
+ std::lock_guard<std::recursive_mutex> guard(m_unwind_mutex);
if (frame_idx < m_pcs.size())
{
cfa = frame_idx;
OpenPOWER on IntegriCloud