diff options
Diffstat (limited to 'contrib/llvm/tools/lldb/source/Utility/TaskPool.cpp')
-rw-r--r-- | contrib/llvm/tools/lldb/source/Utility/TaskPool.cpp | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/contrib/llvm/tools/lldb/source/Utility/TaskPool.cpp b/contrib/llvm/tools/lldb/source/Utility/TaskPool.cpp index 75fe59d..c5c63a2 100644 --- a/contrib/llvm/tools/lldb/source/Utility/TaskPool.cpp +++ b/contrib/llvm/tools/lldb/source/Utility/TaskPool.cpp @@ -61,8 +61,9 @@ TaskPoolImpl::AddTask(std::function<void()>&& task_fn) if (m_thread_count < max_threads) { m_thread_count++; - lock.unlock(); - + // Note that this detach call needs to happen with the m_tasks_mutex held. This prevents the thread + // from exiting prematurely and triggering a linux libc bug + // (https://sourceware.org/bugzilla/show_bug.cgi?id=19951). std::thread (Worker, this).detach(); } } |