summaryrefslogtreecommitdiffstats
path: root/lldb/source/Target/Thread.cpp
diff options
context:
space:
mode:
authorAndrew Kaylor <andrew.kaylor@intel.com>2013-05-10 17:19:04 +0000
committerAndrew Kaylor <andrew.kaylor@intel.com>2013-05-10 17:19:04 +0000
commit29d65744c9290f901cc86a096be942a97a649b61 (patch)
tree09084e672f8e2950a245702058fe2a414cc1f384 /lldb/source/Target/Thread.cpp
parent72a196a159b28f26f84d9afec8b2baac11d367bc (diff)
downloadbcm5719-llvm-29d65744c9290f901cc86a096be942a97a649b61.tar.gz
bcm5719-llvm-29d65744c9290f901cc86a096be942a97a649b61.zip
Adding support for setting thread stop state when a process stops.
This re-submission of this patch fixes a problem where the code sometimes caused a deadlock. The Process::SetPrivateState method was locking the Process::m_private_state variable and then later calling ThreadList::DidStop, which locks the ThreadList mutex. Other methods in ThreadList which were being called from other threads lock the ThreadList mutex and then call Process::GetPrivateState which locks the Process::m_private_state mutex. To avoid deadlocks, Process::SetPrivateState now locks the ThreadList mutex before locking the Process::m_private_state mutex. llvm-svn: 181609
Diffstat (limited to 'lldb/source/Target/Thread.cpp')
-rw-r--r--lldb/source/Target/Thread.cpp6
1 files changed, 6 insertions, 0 deletions
diff --git a/lldb/source/Target/Thread.cpp b/lldb/source/Target/Thread.cpp
index 646a63511e9..c4aa2544682 100644
--- a/lldb/source/Target/Thread.cpp
+++ b/lldb/source/Target/Thread.cpp
@@ -658,6 +658,12 @@ Thread::DidResume ()
SetResumeSignal (LLDB_INVALID_SIGNAL_NUMBER);
}
+void
+Thread::DidStop ()
+{
+ SetState (eStateStopped);
+}
+
bool
Thread::ShouldStop (Event* event_ptr)
{
OpenPOWER on IntegriCloud