diff options
Diffstat (limited to 'include/lldb/Target/Unwind.h')
| -rw-r--r-- | include/lldb/Target/Unwind.h | 37 |
1 files changed, 16 insertions, 21 deletions
diff --git a/include/lldb/Target/Unwind.h b/include/lldb/Target/Unwind.h index 17c6c0df8207..09ba87a42bbe 100644 --- a/include/lldb/Target/Unwind.h +++ b/include/lldb/Target/Unwind.h @@ -12,10 +12,11 @@ // C Includes // C++ Includes +#include <mutex> + // Other libraries and framework includes // Project includes #include "lldb/lldb-private.h" -#include "lldb/Host/Mutex.h" namespace lldb_private { @@ -25,11 +26,7 @@ protected: //------------------------------------------------------------------ // Classes that inherit from Unwind can see and modify these //------------------------------------------------------------------ - Unwind(Thread &thread) : - m_thread (thread), - m_unwind_mutex(Mutex::eMutexTypeRecursive) - { - } + Unwind(Thread &thread) : m_thread(thread), m_unwind_mutex() {} public: virtual @@ -40,18 +37,17 @@ public: void Clear() { - Mutex::Locker locker(m_unwind_mutex); + std::lock_guard<std::recursive_mutex> guard(m_unwind_mutex); DoClear(); - } uint32_t GetFrameCount() { - Mutex::Locker locker(m_unwind_mutex); + std::lock_guard<std::recursive_mutex> guard(m_unwind_mutex); return DoGetFrameCount(); } - + uint32_t GetFramesUpTo (uint32_t end_idx) { @@ -70,21 +66,19 @@ public: } bool - GetFrameInfoAtIndex (uint32_t frame_idx, - lldb::addr_t& cfa, - lldb::addr_t& pc) + GetFrameInfoAtIndex(uint32_t frame_idx, lldb::addr_t &cfa, lldb::addr_t &pc) { - Mutex::Locker locker(m_unwind_mutex); - return DoGetFrameInfoAtIndex (frame_idx, cfa, pc); + std::lock_guard<std::recursive_mutex> guard(m_unwind_mutex); + return DoGetFrameInfoAtIndex(frame_idx, cfa, pc); } - + lldb::RegisterContextSP - CreateRegisterContextForFrame (StackFrame *frame) + CreateRegisterContextForFrame(StackFrame *frame) { - Mutex::Locker locker(m_unwind_mutex); - return DoCreateRegisterContextForFrame (frame); + std::lock_guard<std::recursive_mutex> guard(m_unwind_mutex); + return DoCreateRegisterContextForFrame(frame); } - + Thread & GetThread() { @@ -110,7 +104,8 @@ protected: DoCreateRegisterContextForFrame (StackFrame *frame) = 0; Thread &m_thread; - Mutex m_unwind_mutex; + std::recursive_mutex m_unwind_mutex; + private: DISALLOW_COPY_AND_ASSIGN (Unwind); }; |
