summaryrefslogtreecommitdiffstats
path: root/src/corelib/thread/qthreadpool.cpp
diff options
context:
space:
mode:
authorAllan Sandfeld Jensen <allan.jensen@qt.io>2024-11-15 10:44:05 +0100
committerAllan Sandfeld Jensen <allan.jensen@qt.io>2024-12-05 22:04:46 +0100
commit083e44318cb481180357a0a27a3d93a85242cff3 (patch)
treec68ce6f5dbcbec2d0a587ee9052518e605b3467f /src/corelib/thread/qthreadpool.cpp
parent154fe8d8034f238180418ce32ac18bd6ab6df14a (diff)
Make multi-threaded image transforms and painter fills configurable
Some users prefer to avoid having this many threads. This also moves disabling it for WASM from sources to config. Fixes: QTBUG-129650 Change-Id: Ib4c7903e85ba9cb75a9e013d1032653ea0ab8b84 Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com>
Diffstat (limited to 'src/corelib/thread/qthreadpool.cpp')
-rw-r--r--src/corelib/thread/qthreadpool.cpp22
1 files changed, 0 insertions, 22 deletions
diff --git a/src/corelib/thread/qthreadpool.cpp b/src/corelib/thread/qthreadpool.cpp
index 62e3773af95..f326ed21229 100644
--- a/src/corelib/thread/qthreadpool.cpp
+++ b/src/corelib/thread/qthreadpool.cpp
@@ -475,28 +475,6 @@ QThreadPool *QThreadPool::globalInstance()
}
/*!
- Returns the QThreadPool instance for Qt Gui.
- \internal
-*/
-QThreadPool *QThreadPoolPrivate::qtGuiInstance()
-{
- Q_CONSTINIT static QPointer<QThreadPool> guiInstance;
- Q_CONSTINIT static QBasicMutex theMutex;
- const static bool runtime_disable = qEnvironmentVariableIsSet("QT_NO_GUI_THREADPOOL");
- if (runtime_disable)
- return nullptr;
- const QMutexLocker locker(&theMutex);
- if (guiInstance.isNull() && !QCoreApplication::closingDown()) {
- guiInstance = new QThreadPool();
- // Limit max thread to avoid too many parallel threads.
- // We are not optimized for much more than 4 or 8 threads.
- if (guiInstance && guiInstance->maxThreadCount() > 4)
- guiInstance->setMaxThreadCount(qBound(4, guiInstance->maxThreadCount() / 2, 8));
- }
- return guiInstance;
-}
-
-/*!
Reserves a thread and uses it to run \a runnable, unless this thread will
make the current thread count exceed maxThreadCount(). In that case,
\a runnable is added to a run queue instead. The \a priority argument can