summaryrefslogtreecommitdiff
path: root/source/Target/ExecutionContext.cpp
diff options
context:
space:
mode:
authorEd Maste <emaste@FreeBSD.org>2015-02-09 01:44:09 +0000
committerEd Maste <emaste@FreeBSD.org>2015-02-09 01:44:09 +0000
commit12bd4897ff0678fa663e09d78ebc22dd255ceb86 (patch)
treea8f4b3abea3e6937e60728991c736e6e3d322fc1 /source/Target/ExecutionContext.cpp
parent205afe679855a4ce8149cdaa94d3f0868ce796dc (diff)
Notes
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 db4025f40c05..e03a560bd063 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)