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.
git-svn-id: https://llvm.org/svn/llvm-project/lldb/trunk@163541 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/source/Commands/CommandObjectThread.cpp b/source/Commands/CommandObjectThread.cpp
index 7cb8273..93ecf36 100644
--- a/source/Commands/CommandObjectThread.cpp
+++ b/source/Commands/CommandObjectThread.cpp
@@ -185,6 +185,7 @@
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 @@
{
uint32_t num_args = command.GetArgumentCount();
Process *process = m_interpreter.GetExecutionContext().GetProcessPtr();
+ Mutex::Locker locker (process->GetThreadList().GetMutex());
std::vector<ThreadSP> thread_sps;
for (uint32_t i = 0; i < num_args; i++)