diff --git a/src/concurrent/qtconcurrentiteratekernel.cpp b/src/concurrent/qtconcurrentiteratekernel.cpp index 45b54ecfdc..430ae89c85 100644 --- a/src/concurrent/qtconcurrentiteratekernel.cpp +++ b/src/concurrent/qtconcurrentiteratekernel.cpp @@ -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) { } diff --git a/src/concurrent/qtconcurrentiteratekernel.h b/src/concurrent/qtconcurrentiteratekernel.h index 6ea96f5097..a8decf5cf8 100644 --- a/src/concurrent/qtconcurrentiteratekernel.h +++ b/src/concurrent/qtconcurrentiteratekernel.h @@ -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 resultReporter(this); for(;;) {