diff options
-rw-r--r-- | lldb/include/lldb/Target/Process.h | 1 | ||||
-rw-r--r-- | lldb/source/Target/Process.cpp | 5 |
2 files changed, 5 insertions, 1 deletions
diff --git a/lldb/include/lldb/Target/Process.h b/lldb/include/lldb/Target/Process.h index 11859df69b3..eb8f02fe7e2 100644 --- a/lldb/include/lldb/Target/Process.h +++ b/lldb/include/lldb/Target/Process.h @@ -3402,6 +3402,7 @@ protected: bool m_destroy_in_process; bool m_can_interpret_function_calls; // Some targets, e.g the OSX kernel, don't support the ability to modify the stack. WarningsCollection m_warnings_issued; // A set of object pointers which have already had warnings printed + std::mutex m_run_thread_plan_lock; enum { eCanJITDontKnow= 0, diff --git a/lldb/source/Target/Process.cpp b/lldb/source/Target/Process.cpp index 85b0abb31aa..d4938094134 100644 --- a/lldb/source/Target/Process.cpp +++ b/lldb/source/Target/Process.cpp @@ -771,6 +771,7 @@ Process::Process(lldb::TargetSP target_sp, ListenerSP listener_sp, const UnixSig m_destroy_in_process(false), m_can_interpret_function_calls(false), m_warnings_issued(), + m_run_thread_plan_lock(), m_can_jit(eCanJITDontKnow) { CheckInWithManager(); @@ -5195,6 +5196,8 @@ Process::RunThreadPlan(ExecutionContext &exe_ctx, lldb::ThreadPlanSP &thread_pla const EvaluateExpressionOptions &options, DiagnosticManager &diagnostic_manager) { ExpressionResults return_value = eExpressionSetupError; + + std::lock_guard<std::mutex> run_thread_plan_locker(m_run_thread_plan_lock); if (!thread_plan_sp) { @@ -5223,7 +5226,7 @@ Process::RunThreadPlan(ExecutionContext &exe_ctx, lldb::ThreadPlanSP &thread_pla // We need to change some of the thread plan attributes for the thread plan runner. This will restore them // when we are done: - + RestorePlanState thread_plan_restorer(thread_plan_sp); // We rely on the thread plan we are running returning "PlanCompleted" if when it successfully completes. |