summaryrefslogtreecommitdiffstats
path: root/lldb/source/Target/ThreadList.cpp
diff options
context:
space:
mode:
authorGreg Clayton <gclayton@apple.com>2014-02-13 23:34:38 +0000
committerGreg Clayton <gclayton@apple.com>2014-02-13 23:34:38 +0000
commite98008cc587749568a6661931ed8973b64f7c2f7 (patch)
treeedd79f6e2f5e7e6d92a76d7bb14f28ddab54bb95 /lldb/source/Target/ThreadList.cpp
parent967bf5813fb609940fa06510ad70d48268c362d5 (diff)
downloadbcm5719-llvm-e98008cc587749568a6661931ed8973b64f7c2f7.tar.gz
bcm5719-llvm-e98008cc587749568a6661931ed8973b64f7c2f7.zip
Fixed deadlocks that could occur when using python for breakpoints, operating system plugins, and other async python usage.
<rdar://problem/16054348> <rdar://problem/16040833> llvm-svn: 201372
Diffstat (limited to 'lldb/source/Target/ThreadList.cpp')
-rw-r--r--lldb/source/Target/ThreadList.cpp11
1 files changed, 11 insertions, 0 deletions
diff --git a/lldb/source/Target/ThreadList.cpp b/lldb/source/Target/ThreadList.cpp
index b6ffd3da442..4fffdac9a34 100644
--- a/lldb/source/Target/ThreadList.cpp
+++ b/lldb/source/Target/ThreadList.cpp
@@ -85,6 +85,17 @@ ThreadList::AddThread (const ThreadSP &thread_sp)
m_threads.push_back(thread_sp);
}
+void
+ThreadList::InsertThread (const lldb::ThreadSP &thread_sp, uint32_t idx)
+{
+ Mutex::Locker locker(GetMutex());
+ if (idx < m_threads.size())
+ m_threads.insert(m_threads.begin() + idx, thread_sp);
+ else
+ m_threads.push_back (thread_sp);
+}
+
+
uint32_t
ThreadList::GetSize (bool can_update)
{
OpenPOWER on IntegriCloud