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-23 23:53:15 +0000
commit0b0fd45b50c04c2a9979c1cf8aed43c23a80cae8 (patch)
treeab1d4b716e6880625eba02a6889973aba6c485ac
parentb6d9498192e589b1113d14ffb6b1c7fba2a7b468 (diff)
Start using a dedicated QThreadPool again instead of a global one6.3
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 36ab5ba40..6dfd9f320 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());