summaryrefslogtreecommitdiffstats
path: root/source/Target/ExecutionContext.cpp
diff options
context:
space:
mode:
authoremaste <emaste@FreeBSD.org>2015-02-09 01:44:09 +0000
committeremaste <emaste@FreeBSD.org>2015-02-09 01:44:09 +0000
commitd61b076ede88b56f3372a55e7d1eac6a9d717120 (patch)
treea8f4b3abea3e6937e60728991c736e6e3d322fc1 /source/Target/ExecutionContext.cpp
parent0c2019f4ca6b2dc6d710f6bb16a0e3ed10271531 (diff)
downloadFreeBSD-src-d61b076ede88b56f3372a55e7d1eac6a9d717120.zip
FreeBSD-src-d61b076ede88b56f3372a55e7d1eac6a9d717120.tar.gz
Import LLDB as of upstream SVN 228549 (git 39760838)
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