summaryrefslogtreecommitdiffstats
path: root/src/concurrent
diff options
context:
space:
mode:
Diffstat (limited to 'src/concurrent')
-rw-r--r--src/concurrent/qtconcurrentiteratekernel.cpp2
-rw-r--r--src/concurrent/qtconcurrentrun.cpp9
-rw-r--r--src/concurrent/qtconcurrentthreadengine.h4
3 files changed, 12 insertions, 3 deletions
diff --git a/src/concurrent/qtconcurrentiteratekernel.cpp b/src/concurrent/qtconcurrentiteratekernel.cpp
index 430ae89c85..268db56246 100644
--- a/src/concurrent/qtconcurrentiteratekernel.cpp
+++ b/src/concurrent/qtconcurrentiteratekernel.cpp
@@ -131,7 +131,7 @@ void BlockSizeManager::timeAfterUser()
if (controlPartElapsed.isMedianValid() == false)
return;
- if (controlPartElapsed.median() * TargetRatio < userPartElapsed.median())
+ if (controlPartElapsed.median() * int(TargetRatio) < userPartElapsed.median())
return;
m_blockSize = qMin(m_blockSize * 2, maxBlockSize);
diff --git a/src/concurrent/qtconcurrentrun.cpp b/src/concurrent/qtconcurrentrun.cpp
index 8347440b66..18bcf332ac 100644
--- a/src/concurrent/qtconcurrentrun.cpp
+++ b/src/concurrent/qtconcurrentrun.cpp
@@ -194,6 +194,11 @@
\snippet code/src_concurrent_qtconcurrentrun.cpp 11
+ \note There's no need to call QPromise::start() and QPromise::finish() to
+ indicate the beginning and the end of computation (like you would normally do when
+ using QPromise). QtConcurrent::run() will always call them before starting and
+ after finishing the execution.
+
\section2 Suspending and canceling the execution
The QPromise API also enables suspending and canceling the computation, if requested:
@@ -215,6 +220,10 @@
call to \c promise.isCanceled() will return \c true and
\c aFunction will return immediately without any further result reporting.
+ \note There's no need to call QPromise::finish() to stop the computation
+ after the cancellation (like you would normally do when using QPromise).
+ QtConcurrent::run() will always call it after finishing the execution.
+
\section2 Progress reporting
It's also possible to report the progress of a task
diff --git a/src/concurrent/qtconcurrentthreadengine.h b/src/concurrent/qtconcurrentthreadengine.h
index cbd8ad04d7..4cd5b85210 100644
--- a/src/concurrent/qtconcurrentthreadengine.h
+++ b/src/concurrent/qtconcurrentthreadengine.h
@@ -256,8 +256,8 @@ template <>
class ThreadEngineStarter<void> : public ThreadEngineStarterBase<void>
{
public:
- ThreadEngineStarter<void>(ThreadEngine<void> *_threadEngine)
- :ThreadEngineStarterBase<void>(_threadEngine) {}
+ ThreadEngineStarter(ThreadEngine<void> *_threadEngine)
+ : ThreadEngineStarterBase<void>(_threadEngine) {}
void startBlocking()
{