summaryrefslogtreecommitdiffstats
path: root/src/core/jobs/qthreadpooler_p.h
diff options
context:
space:
mode:
authorPaul Lemire <paul.lemire@kdab.com>2020-05-04 08:43:22 +0200
committerPaul Lemire <paul.lemire@kdab.com>2020-05-07 12:18:12 +0200
commit1097607f112e79ddb4fc08d012db95faa193c4ea (patch)
tree6e663574e6d2f466b4384785f0714ab7c2ef9450 /src/core/jobs/qthreadpooler_p.h
parent764924da8ab3255c1b8d1ad5b39f85675f4b855e (diff)
Centralize the maxThreadCount information
Add a static function on QThreadPooler which returns the ideal thread count (capped by QT3D_MAX_THREAD_COUNT) if set. Call that function from all places that need that information. Avoids code duplication and potentially reading the env value every frame. Change-Id: I699691af33ed0a65aa557ed48aabb9de8929dcc2 Reviewed-by: Mike Krus <mike.krus@kdab.com>
Diffstat (limited to 'src/core/jobs/qthreadpooler_p.h')
-rw-r--r--src/core/jobs/qthreadpooler_p.h2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/core/jobs/qthreadpooler_p.h b/src/core/jobs/qthreadpooler_p.h
index 43a67033e..ea69b5b78 100644
--- a/src/core/jobs/qthreadpooler_p.h
+++ b/src/core/jobs/qthreadpooler_p.h
@@ -77,7 +77,7 @@ public:
void taskFinished(RunnableInterface *task);
QFuture<void> future();
- int maxThreadCount() const;
+ static int maxThreadCount();
private:
void enqueueTasks(const QVector<RunnableInterface *> &tasks);