summaryrefslogtreecommitdiffstats
path: root/source/Target/ExecutionContext.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'source/Target/ExecutionContext.cpp')
-rw-r--r--source/Target/ExecutionContext.cpp6
1 files changed, 5 insertions, 1 deletions
diff --git a/source/Target/ExecutionContext.cpp b/source/Target/ExecutionContext.cpp
index db4025f..e03a560 100644
--- a/source/Target/ExecutionContext.cpp
+++ b/source/Target/ExecutionContext.cpp
@@ -705,7 +705,11 @@ ExecutionContextRef::SetTargetPtr (Target* target, bool adopt_selected)
if (process_sp)
{
// Only fill in the thread and frame if our process is stopped
- if (StateIsStoppedState (process_sp->GetState(), true))
+ // Don't just check the state, since we might be in the middle of
+ // resuming.
+ Process::StopLocker stop_locker;
+
+ if (stop_locker.TryLock(&process_sp->GetRunLock()) && StateIsStoppedState (process_sp->GetState(), true))
{
lldb::ThreadSP thread_sp (process_sp->GetThreadList().GetSelectedThread());
if (!thread_sp)
OpenPOWER on IntegriCloud