diff options
author | Laszlo Agocs <laszlo.agocs@theqtcompany.com> | 2015-07-31 11:25:23 +0200 |
---|---|---|
committer | Laszlo Agocs <laszlo.agocs@theqtcompany.com> | 2015-07-31 09:30:36 +0000 |
commit | cbeade7bde94a795eed14cdeadcb79184fa87858 (patch) | |
tree | 1d0e5c9b30e50562b7469bd3893553cd55ff19bc /src/core/jobs/qthreadpooler.cpp | |
parent | 162543b1d55d680cbe630a7ed25d9bc6c72a5437 (diff) |
Expose the max thread count from the pooler
Assuming that the pooler allows up to idealThreadCount() threads
is only true when the default settings of QThreadPool are in use.
Once the limit gets reduced via setMaxThreadCount(), we get a deadlock.
So expose the max number of threads (like with ThreadWeaver) from
QThreadPooler and use that value instaed.
Change-Id: I1ec0789da5f52a5b333b24f4b3b37dd487c69841
Reviewed-by: Paul Lemire <paul.lemire@kdab.com>
Diffstat (limited to 'src/core/jobs/qthreadpooler.cpp')
-rw-r--r-- | src/core/jobs/qthreadpooler.cpp | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/src/core/jobs/qthreadpooler.cpp b/src/core/jobs/qthreadpooler.cpp index 5e1c2749d..aea393cab 100644 --- a/src/core/jobs/qthreadpooler.cpp +++ b/src/core/jobs/qthreadpooler.cpp @@ -164,6 +164,11 @@ int QThreadPooler::currentCount() return m_taskCount.load(); } +int QThreadPooler::maxThreadCount() const +{ + return QThreadPool::globalInstance()->maxThreadCount(); +} + } // namespace Qt3D QT_END_NAMESPACE |