From 41f2b940c974b0ef7082a638cd23f128e167e8d1 Mon Sep 17 00:00:00 2001 From: Jim Ingham Date: Mon, 10 Sep 2012 20:50:15 +0000 Subject: 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 --- lldb/source/Commands/CommandObjectThread.cpp | 2 ++ 1 file changed, 2 insertions(+) (limited to 'lldb/source/Commands/CommandObjectThread.cpp') diff --git a/lldb/source/Commands/CommandObjectThread.cpp b/lldb/source/Commands/CommandObjectThread.cpp index 7cb8273cf39..93ecf36fdd2 100644 --- a/lldb/source/Commands/CommandObjectThread.cpp +++ b/lldb/source/Commands/CommandObjectThread.cpp @@ -185,6 +185,7 @@ protected: else if (command.GetArgumentCount() == 1 && ::strcmp (command.GetArgumentAtIndex(0), "all") == 0) { Process *process = m_interpreter.GetExecutionContext().GetProcessPtr(); + Mutex::Locker locker (process->GetThreadList().GetMutex()); uint32_t num_threads = process->GetThreadList().GetSize(); for (uint32_t i = 0; i < num_threads; i++) { @@ -208,6 +209,7 @@ protected: { uint32_t num_args = command.GetArgumentCount(); Process *process = m_interpreter.GetExecutionContext().GetProcessPtr(); + Mutex::Locker locker (process->GetThreadList().GetMutex()); std::vector thread_sps; for (uint32_t i = 0; i < num_args; i++) -- cgit v1.2.3