summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDominik Holland <dominik.holland@qt.io>2022-08-23 10:03:41 +0200
committerQt Cherry-pick Bot <cherrypick_bot@qt-project.org>2022-08-24 07:28:54 +0000
commit861464e5f878846fd26dd4b6d52af6636ff020f8 (patch)
treef851773e907da831e90cf15699cf946a17c386ad
parent21b04a982d005f220161965f3fa06e2bfdc891eb (diff)
downloadqt3d-861464e5f878846fd26dd4b6d52af6636ff020f8.tar.gz
Start using a dedicated QThreadPool again instead of a global one
This basically reverts a2b5b5c8f6e09ccfaca8044b34f4d9675c3be14a. The global thread pool is also available to the user and by changing the max thread count to something lower than the default, already running threads get stopped, which can cause segfaults. Fixes: QTBUG-104593 Change-Id: I21fea3137ea72b3336bc67499f9ee2f846e18845 Reviewed-by: Paul Lemire <paul.lemire@kdab.com> (cherry picked from commit f286d11852d956e589e30cf32686179baa28f66c) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
-rw-r--r--src/core/jobs/qthreadpooler.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/core/jobs/qthreadpooler.cpp b/src/core/jobs/qthreadpooler.cpp
index 8636fa9b4..5b97abd45 100644
--- a/src/core/jobs/qthreadpooler.cpp
+++ b/src/core/jobs/qthreadpooler.cpp
@@ -14,7 +14,7 @@ QThreadPooler::QThreadPooler(QObject *parent)
, m_futureInterface(nullptr)
, m_mutex()
, m_taskCount(0)
- , m_threadPool(QThreadPool::globalInstance())
+ , m_threadPool(new QThreadPool(this))
, m_totalRunJobs(0)
{
m_threadPool->setMaxThreadCount(QAspectJobManager::idealThreadCount());