summaryrefslogtreecommitdiffstats
path: root/lldb/source/Target/Process.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/Target/Process.cpp
parent1e4f425d2f0df8e79ad198d593ac7e620173938b (diff)
downloadbcm5719-llvm-4fc6cb9c7685552842f39159146be23ffead16c5.tar.gz
bcm5719-llvm-4fc6cb9c7685552842f39159146be23ffead16c5.zip
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/Target/Process.cpp')
-rw-r--r--lldb/source/Target/Process.cpp2
1 files changed, 2 insertions, 0 deletions
diff --git a/lldb/source/Target/Process.cpp b/lldb/source/Target/Process.cpp
index 29f3793c360..454cf3a51e6 100644
--- a/lldb/source/Target/Process.cpp
+++ b/lldb/source/Target/Process.cpp
@@ -921,6 +921,7 @@ Process::Process(Target &target, Listener &listener) :
m_next_event_action_ap(),
m_run_lock (),
m_currently_handling_event(false),
+ m_finalize_called(false),
m_can_jit(eCanJITDontKnow)
{
CheckInWithManager ();
@@ -1016,6 +1017,7 @@ Process::Finalize()
m_allocated_memory_cache.Clear();
m_language_runtimes.clear();
m_next_event_action_ap.reset();
+ m_finalize_called = true;
}
void
OpenPOWER on IntegriCloud