aboutsummaryrefslogtreecommitdiff
path: root/lldb/source/API/SBProcess.cpp
diff options
context:
space:
mode:
authorJim Ingham <jingham@apple.com>2012-08-22 21:34:33 +0000
committerJim Ingham <jingham@apple.com>2012-08-22 21:34:33 +0000
commit4fc6cb9c7685552842f39159146be23ffead16c5 (patch)
treebc93d4d6358c57a5ff6e49b7a47717fb39fd71be /lldb/source/API/SBProcess.cpp
parent1e4f425d2f0df8e79ad198d593ac7e620173938b (diff)
downloadllvm-4fc6cb9c7685552842f39159146be23ffead16c5.zip
llvm-4fc6cb9c7685552842f39159146be23ffead16c5.tar.gz
llvm-4fc6cb9c7685552842f39159146be23ffead16c5.tar.bz2
Rework how the API mutex is acquired when filling out an ExecutionContext from an ExecutionContextRef,
particularly in the SBThread & SBFrame interfaces. Instead of filling the whole context & then getting the API mutex, we now get only the target, acquire the API mutex from it, then fill out the rest of the context. This removes a race condition where you get a ThreadSP, then wait on the API mutex while another command Destroy's the Thread you've just gotten. Also fixed the ExecutionContextRef::Get*SP calls so they don't return invalid objects. Also fixed the ExecutionContext::Has*Scope calls so they don't claim to have a scope if the object representing that scope has been destroyed. Also fixed a think-o in Thread::IsValid which was causing it to return the opposite of the desired value. <rdar://problem/11995490> llvm-svn: 162401
Diffstat (limited to 'lldb/source/API/SBProcess.cpp')
-rw-r--r--lldb/source/API/SBProcess.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/lldb/source/API/SBProcess.cpp b/lldb/source/API/SBProcess.cpp
index 129f887..e556904 100644
--- a/lldb/source/API/SBProcess.cpp
+++ b/lldb/source/API/SBProcess.cpp
@@ -102,7 +102,8 @@ SBProcess::Clear ()
bool
SBProcess::IsValid() const
{
- return m_opaque_wp.lock().get() != NULL;
+ ProcessSP process_sp(m_opaque_wp.lock());
+ return ((bool) process_sp && process_sp->IsValid());
}
bool