From 145449b1e420787bb99721a429341fa6be3adfb6 Mon Sep 17 00:00:00 2001 From: Dimitry Andric Date: Sun, 3 Jul 2022 16:10:23 +0200 Subject: Vendor import of llvm-project main llvmorg-15-init-15358-g53dc0f107877. --- lldb/source/Target/ThreadPlanStack.cpp | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'lldb/source/Target/ThreadPlanStack.cpp') diff --git a/lldb/source/Target/ThreadPlanStack.cpp b/lldb/source/Target/ThreadPlanStack.cpp index 80634647f9e0..ac7b44cef37d 100644 --- a/lldb/source/Target/ThreadPlanStack.cpp +++ b/lldb/source/Target/ThreadPlanStack.cpp @@ -400,6 +400,7 @@ void ThreadPlanStackMap::Update(ThreadList ¤t_threads, bool delete_missing, bool check_for_new) { + std::lock_guard guard(m_stack_map_mutex); // Now find all the new threads and add them to the map: if (check_for_new) { for (auto thread : current_threads.Threads()) { @@ -434,6 +435,7 @@ void ThreadPlanStackMap::DumpPlans(Stream &strm, lldb::DescriptionLevel desc_level, bool internal, bool condense_if_trivial, bool skip_unreported) { + std::lock_guard guard(m_stack_map_mutex); for (auto &elem : m_plans_list) { lldb::tid_t tid = elem.first; uint32_t index_id = 0; @@ -470,6 +472,7 @@ bool ThreadPlanStackMap::DumpPlansForTID(Stream &strm, lldb::tid_t tid, bool internal, bool condense_if_trivial, bool skip_unreported) { + std::lock_guard guard(m_stack_map_mutex); uint32_t index_id = 0; ThreadSP thread_sp = m_process.GetThreadList().FindThreadByID(tid); @@ -509,6 +512,7 @@ bool ThreadPlanStackMap::DumpPlansForTID(Stream &strm, lldb::tid_t tid, bool ThreadPlanStackMap::PrunePlansForTID(lldb::tid_t tid) { // We only remove the plans for unreported TID's. + std::lock_guard guard(m_stack_map_mutex); ThreadSP thread_sp = m_process.GetThreadList().FindThreadByID(tid); if (thread_sp) return false; -- cgit v1.3