================
@@ -125,17 +125,21 @@ ExecutionContext::ExecutionContext(const 
ExecutionContextRef *exe_ctx_ref_ptr,
   }
 }
 
-ExecutionContext::ExecutionContext(const ExecutionContextRef *exe_ctx_ref_ptr,
-                                   std::unique_lock<std::recursive_mutex> 
&lock)
+ExecutionContext::ExecutionContext(
+    const ExecutionContextRef *exe_ctx_ref_ptr,
+    std::unique_lock<std::recursive_mutex> &lock,
+    ProcessRunLock::ProcessRunLocker &stop_locker)
     : m_target_sp(), m_process_sp(), m_thread_sp(), m_frame_sp() {
   if (exe_ctx_ref_ptr) {
     m_target_sp = exe_ctx_ref_ptr->GetTargetSP();
     if (m_target_sp) {
       lock = 
std::unique_lock<std::recursive_mutex>(m_target_sp->GetAPIMutex());
 
       m_process_sp = exe_ctx_ref_ptr->GetProcessSP();
-      m_thread_sp = exe_ctx_ref_ptr->GetThreadSP();
-      m_frame_sp = exe_ctx_ref_ptr->GetFrameSP();
+      if (m_process_sp && stop_locker.TryLock(&m_process_sp->GetRunLock())) {
----------------
felipepiovezan wrote:

I've updated the entire constructor based on the general feedback in this 
review.

https://github.com/llvm/llvm-project/pull/152020
_______________________________________________
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits

Reply via email to