summaryrefslogtreecommitdiffstats
path: root/src/corelib/thread/qthreadpool.cpp
diff options
context:
space:
mode:
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();