summaryrefslogtreecommitdiffstats
path: root/src/core/jobs/qthreadpooler.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/core/jobs/qthreadpooler.cpp')
-rw-r--r--src/core/jobs/qthreadpooler.cpp21
1 files changed, 2 insertions, 19 deletions
diff --git a/src/core/jobs/qthreadpooler.cpp b/src/core/jobs/qthreadpooler.cpp
index b4c7a2b05..b2f53b7e7 100644
--- a/src/core/jobs/qthreadpooler.cpp
+++ b/src/core/jobs/qthreadpooler.cpp
@@ -38,6 +38,7 @@
****************************************************************************/
#include "qthreadpooler_p.h"
+#include "qaspectjobmanager_p.h"
#include <QtCore/QDebug>
QT_BEGIN_NAMESPACE
@@ -52,7 +53,7 @@ QThreadPooler::QThreadPooler(QObject *parent)
, m_threadPool(QThreadPool::globalInstance())
, m_totalRunJobs(0)
{
- m_threadPool->setMaxThreadCount(QThreadPooler::maxThreadCount());
+ m_threadPool->setMaxThreadCount(QAspectJobManager::idealThreadCount());
// Ensures that threads will never be recycled
m_threadPool->setExpiryTimeout(-1);
}
@@ -199,24 +200,6 @@ int QThreadPooler::currentCount() const
return m_taskCount.loadRelaxed();
}
-int QThreadPooler::maxThreadCount()
-{
- static int threadCount = 0;
-
- if (threadCount == 0) {
- threadCount = QThread::idealThreadCount();
- const QByteArray maxThreadCount = qgetenv("QT3D_MAX_THREAD_COUNT");
- if (!maxThreadCount.isEmpty()) {
- bool conversionOK = false;
- const int maxThreadCountValue = maxThreadCount.toInt(&conversionOK);
- if (conversionOK)
- threadCount = std::min(threadCount, maxThreadCountValue);
- }
- }
-
- return threadCount;
-}
-
} // namespace Qt3DCore
QT_END_NAMESPACE