summaryrefslogtreecommitdiffstats
path: root/src/corelib/thread/qthreadpool.cpp
diff options
context:
space:
mode:
authorAllan Sandfeld Jensen <allan.jensen@qt.io>2024-11-18 11:09:32 +0100
committerEirik Aavitsland <eirik.aavitsland@qt.io>2024-11-18 17:15:47 +0000
commit7a8cefd6fb66e6bc6880aaf5a938194611278bed (patch)
tree832eb6706c2c89c40a33231af6a5448f1853ecbc /src/corelib/thread/qthreadpool.cpp
parent7b024cc1749494114fffc3c434b58846707a64af (diff)
Facilitate disabling multi-threading in image manipulation and painting
On some platforms and setups, the multi-threaded implementation of this functionality is not desirable. Allow disabling it at runtime by setting the environment variable QT_NO_GUI_THREADPOOL. Pick-to: 6.8 Task-number: QTBUG-129650 Change-Id: If089ecb3b335defc06f14749841bf9f6041e6f5e Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io>
Diffstat (limited to 'src/corelib/thread/qthreadpool.cpp')
-rw-r--r--src/corelib/thread/qthreadpool.cpp4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/corelib/thread/qthreadpool.cpp b/src/corelib/thread/qthreadpool.cpp
index 18d4103fdfc..55f13a6b02a 100644
--- a/src/corelib/thread/qthreadpool.cpp
+++ b/src/corelib/thread/qthreadpool.cpp
@@ -481,7 +481,9 @@ 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();