diff options
author | Liang Qi <liang.qi@theqtcompany.com> | 2016-01-26 18:33:02 +0000 |
---|---|---|
committer | The Qt Project <gerrit-noreply@qt-project.org> | 2016-01-26 19:40:45 +0000 |
commit | f3060312c89344744832e3352fe4f53efcb94c9b (patch) | |
tree | de69be5e25a1acd3207a8952376f634fe94fefcc /src/concurrent/qtconcurrentiteratekernel.h | |
parent | c29d3692d700f7ef6d5833242878b4ec6f81c928 (diff) | |
parent | a15c3d086dafea83e4760f0b447be43d26b80697 (diff) |
Merge "Merge remote-tracking branch 'origin/5.6' into dev" into refs/staging/dev
Diffstat (limited to 'src/concurrent/qtconcurrentiteratekernel.h')
-rw-r--r-- | src/concurrent/qtconcurrentiteratekernel.h | 28 |
1 files changed, 27 insertions, 1 deletions
diff --git a/src/concurrent/qtconcurrentiteratekernel.h b/src/concurrent/qtconcurrentiteratekernel.h index 2540f2f9be..b4360abd26 100644 --- a/src/concurrent/qtconcurrentiteratekernel.h +++ b/src/concurrent/qtconcurrentiteratekernel.h @@ -88,6 +88,32 @@ private: Q_DISABLE_COPY(BlockSizeManager) }; +// ### Qt6: Replace BlockSizeManager with V2 implementation +class Q_CONCURRENT_EXPORT BlockSizeManagerV2 +{ +public: + explicit BlockSizeManagerV2(int iterationCount); + + void timeBeforeUser(); + void timeAfterUser(); + int blockSize(); + +private: + inline bool blockSizeMaxed() + { + return (m_blockSize >= maxBlockSize); + } + + const int maxBlockSize; + qint64 beforeUser; + qint64 afterUser; + MedianDouble controlPartElapsed; + MedianDouble userPartElapsed; + int m_blockSize; + + Q_DISABLE_COPY(BlockSizeManagerV2) +}; + template <typename T> class ResultReporter { @@ -196,7 +222,7 @@ public: ThreadFunctionResult forThreadFunction() { - BlockSizeManager blockSizeManager(iterationCount); + BlockSizeManagerV2 blockSizeManager(iterationCount); ResultReporter<T> resultReporter(this); for(;;) { |