aboutsummaryrefslogtreecommitdiff
path: root/source/Utility/TaskPool.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'source/Utility/TaskPool.cpp')
-rw-r--r--source/Utility/TaskPool.cpp5
1 files changed, 3 insertions, 2 deletions
diff --git a/source/Utility/TaskPool.cpp b/source/Utility/TaskPool.cpp
index 75fe59d1e711..c5c63a20cebc 100644
--- a/source/Utility/TaskPool.cpp
+++ b/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();
}
}