[Lldb-commits] [lldb] Convert the StackFrameList mutex to a shared mutex. (PR #117252)

Pavel Labath via lldb-commits lldb-commits at lists.llvm.org
Fri Nov 22 01:23:53 PST 2024


================
@@ -128,30 +130,41 @@ bool StackFrameList::DecrementCurrentInlinedDepth() {
 }
 
 void StackFrameList::SetCurrentInlinedDepth(uint32_t new_depth) {
+  std::lock_guard<std::mutex> guard(m_inlined_depth_mutex);
   m_current_inlined_depth = new_depth;
   if (new_depth == UINT32_MAX)
     m_current_inlined_pc = LLDB_INVALID_ADDRESS;
   else
     m_current_inlined_pc = m_thread.GetRegisterContext()->GetPC();
 }
 
-void StackFrameList::GetOnlyConcreteFramesUpTo(uint32_t end_idx,
-                                               Unwind &unwinder) {
+void StackFrameList::GetOnlyConcreteFramesUpTo(
+    uint32_t end_idx, Unwind &unwinder,
+    std::shared_lock<std::shared_mutex> &guard) {
----------------
labath wrote:

All of the work of this function is done under the exclusive mutex. Why does it need the lock dance?

https://github.com/llvm/llvm-project/pull/117252


More information about the lldb-commits mailing list