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>
This commit is contained in:
parent
7b024cc174
commit
7a8cefd6fb
@ -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();
|
||||
|
Loading…
x
Reference in New Issue
Block a user