diff options
| author | Kuba Brecka <kuba.brecka@gmail.com> | 2016-05-22 12:24:38 +0000 |
|---|---|---|
| committer | Kuba Brecka <kuba.brecka@gmail.com> | 2016-05-22 12:24:38 +0000 |
| commit | 7380f25d2909a9b4a07efe89277e928ee572e9a8 (patch) | |
| tree | e2b61732127bd19abc3c40f3e5eb92c6ab7c85a7 | |
| parent | 2ba64ab9ae8610f54c5026455eba1fbfd24e0d3d (diff) | |
| download | bcm5719-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.cpp | 3 | ||||
| -rw-r--r-- | lldb/source/Plugins/Process/Utility/HistoryUnwind.cpp | 3 |
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; |

