Pass the thread pool into BlockSizeManager
This was overlooked when enabling setting a custom thread pool for various concurrent methods. Fixes: QTBUG-53465 Change-Id: I8b0a0086e46639639051fe99cf52d049f7bb3bb2 Reviewed-by: Sona Kurazyan <sona.kurazyan@qt.io>
This commit is contained in:
parent
b6a2962a52
commit
9aea74f2c6
@ -102,8 +102,8 @@ namespace QtConcurrent {
|
||||
/*! \internal
|
||||
|
||||
*/
|
||||
BlockSizeManager::BlockSizeManager(int iterationCount)
|
||||
: maxBlockSize(iterationCount / (QThreadPool::globalInstance()->maxThreadCount() * 2)),
|
||||
BlockSizeManager::BlockSizeManager(QThreadPool *pool, int iterationCount)
|
||||
: maxBlockSize(iterationCount / (pool->maxThreadCount() * 2)),
|
||||
beforeUser(0), afterUser(0),
|
||||
m_blockSize(1)
|
||||
{ }
|
||||
|
@ -67,7 +67,7 @@ namespace QtConcurrent {
|
||||
class Q_CONCURRENT_EXPORT BlockSizeManager
|
||||
{
|
||||
public:
|
||||
explicit BlockSizeManager(int iterationCount);
|
||||
explicit BlockSizeManager(QThreadPool *pool, int iterationCount);
|
||||
|
||||
void timeBeforeUser();
|
||||
void timeAfterUser();
|
||||
@ -198,7 +198,7 @@ public:
|
||||
|
||||
ThreadFunctionResult forThreadFunction()
|
||||
{
|
||||
BlockSizeManager blockSizeManager(iterationCount);
|
||||
BlockSizeManager blockSizeManager(ThreadEngineBase::threadPool, iterationCount);
|
||||
ResultReporter<T> resultReporter(this);
|
||||
|
||||
for(;;) {
|
||||
|
Loading…
Reference in New Issue
Block a user