summaryrefslogtreecommitdiffstats
path: root/lldb/source/Commands/CommandObjectProcess.cpp
diff options
context:
space:
mode:
authorJim Ingham <jingham@apple.com>2012-09-10 20:50:15 +0000
committerJim Ingham <jingham@apple.com>2012-09-10 20:50:15 +0000
commit41f2b940c974b0ef7082a638cd23f128e167e8d1 (patch)
tree5c6eb0f38531bfe13996f7c78eb6d8b47f12cc4d /lldb/source/Commands/CommandObjectProcess.cpp
parent7acbf00f969095bf517bd5b234f634d6c56d085c (diff)
downloadbcm5719-llvm-41f2b940c974b0ef7082a638cd23f128e167e8d1.tar.gz
bcm5719-llvm-41f2b940c974b0ef7082a638cd23f128e167e8d1.zip
Fixed a few places where we were doing:
uint32_t size = ThreadList.GetSize(); for (i=0; i < size; ++i) without grabbing the thread list mutex. llvm-svn: 163541
Diffstat (limited to 'lldb/source/Commands/CommandObjectProcess.cpp')
-rw-r--r--lldb/source/Commands/CommandObjectProcess.cpp15
1 files changed, 9 insertions, 6 deletions
diff --git a/lldb/source/Commands/CommandObjectProcess.cpp b/lldb/source/Commands/CommandObjectProcess.cpp
index e744b58dc5b..f1d3eb38d7d 100644
--- a/lldb/source/Commands/CommandObjectProcess.cpp
+++ b/lldb/source/Commands/CommandObjectProcess.cpp
@@ -792,14 +792,17 @@ protected:
}
}
- const uint32_t num_threads = process->GetThreadList().GetSize();
+ { // Scope for thread list mutex:
+ Mutex::Locker locker (process->GetThreadList().GetMutex());
+ const uint32_t num_threads = process->GetThreadList().GetSize();
- // Set the actions that the threads should each take when resuming
- for (uint32_t idx=0; idx<num_threads; ++idx)
- {
- process->GetThreadList().GetThreadAtIndex(idx)->SetResumeState (eStateRunning);
+ // Set the actions that the threads should each take when resuming
+ for (uint32_t idx=0; idx<num_threads; ++idx)
+ {
+ process->GetThreadList().GetThreadAtIndex(idx)->SetResumeState (eStateRunning);
+ }
}
-
+
Error error(process->Resume());
if (error.Success())
{
OpenPOWER on IntegriCloud