summaryrefslogtreecommitdiffstats
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 00:23:15 +0000
commitc9bb0a3d1ef819033a674c5c05499d18bc898a70 (patch)
treed0c51490c846f9ab43c86110471610aed23d74b4
parent2a2e4838be697b73b8df7ed72194c31ba8f5d8a3 (diff)
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 51d73e1d8..22a515171 100644
--- a/src/core/jobs/qthreadpooler.cpp
+++ b/src/core/jobs/qthreadpooler.cpp
@@ -50,7 +50,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());