summaryrefslogtreecommitdiffstats
path: root/src/corelib/thread
diff options
context:
space:
mode:
authorAndrei Golubev <andrei.golubev@qt.io>2020-10-14 11:57:59 +0200
committerAndrei Golubev <andrei.golubev@qt.io>2020-10-16 09:48:10 +0200
commit7332d3937dbad3b0995eb38d6e06cc0220a1d2d0 (patch)
tree0a7c2fac585f2a072312c08e0aae333527b5e325 /src/corelib/thread
parent3ca600bd2d02a6950938789cef96229b15ec0cfa (diff)
Rename QPromise starting and finishing methods to start and finish
Proposed during API review Change-Id: I9c43e1915c50803ab69bfe07a91c05d2224b86c4 Reviewed-by: Lars Knoll <lars.knoll@qt.io> Reviewed-by: MÃ¥rten Nordheim <marten.nordheim@qt.io> Reviewed-by: Sona Kurazyan <sona.kurazyan@qt.io>
Diffstat (limited to 'src/corelib/thread')
-rw-r--r--src/corelib/thread/qpromise.h6
-rw-r--r--src/corelib/thread/qpromise.qdoc20
2 files changed, 13 insertions, 13 deletions
diff --git a/src/corelib/thread/qpromise.h b/src/corelib/thread/qpromise.h
index 4225abd771..225ce3dee1 100644
--- a/src/corelib/thread/qpromise.h
+++ b/src/corelib/thread/qpromise.h
@@ -80,7 +80,7 @@ public:
// potential waits
if (!(state & QFutureInterfaceBase::State::Finished)) {
d.cancel();
- reportFinished(); // required to finalize the state
+ finish(); // required to finalize the state
}
}
@@ -97,8 +97,8 @@ public:
void setException(const QException &e) { d.reportException(e); }
void setException(std::exception_ptr e) { d.reportException(e); }
#endif
- void reportStarted() { d.reportStarted(); }
- void reportFinished() { d.reportFinished(); }
+ void start() { d.reportStarted(); }
+ void finish() { d.reportFinished(); }
void suspendIfRequested() { d.suspendIfRequested(); }
diff --git a/src/corelib/thread/qpromise.qdoc b/src/corelib/thread/qpromise.qdoc
index 279bc8766a..d5537efb4d 100644
--- a/src/corelib/thread/qpromise.qdoc
+++ b/src/corelib/thread/qpromise.qdoc
@@ -99,7 +99,7 @@
Destroys the promise.
\note The promise implicitly transitions to a cancelled state on destruction
- unless reportFinished() is called beforehand by the user.
+ unless finish() is called beforehand by the user.
*/
/*! \fn template <typename T> QFuture<T> QPromise<T>::future() const
@@ -136,7 +136,7 @@
execution.
\note This method must not be used after QFuture::cancel() or
- reportFinished().
+ finish().
\sa isCanceled()
*/
@@ -146,25 +146,25 @@
\overload
*/
-/*! \fn template<typename T> void QPromise<T>::reportStarted()
+/*! \fn template<typename T> void QPromise<T>::start()
Reports that the computation is started. Calling this method is important to
state the beginning of the computation as QFuture methods rely on this
information.
- \note Extra attention is required when reportStarted() is called from a
+ \note Extra attention is required when start() is called from a
newly created thread. In such case, the call might naturally be delayed due
to the implementation details of the thread scheduling.
- \sa QFuture::isStarted(), QFuture::waitForFinished(), reportFinished()
+ \sa QFuture::isStarted(), QFuture::waitForFinished(), finish()
*/
-/*! \fn template<typename T> void QPromise<T>::reportFinished()
+/*! \fn template<typename T> void QPromise<T>::finish()
Reports that the computation is finished. Once finished, no new results will
- be added when calling addResult(). This method accompanies reportStarted().
+ be added when calling addResult(). This method accompanies start().
- \sa QFuture::isFinished(), QFuture::waitForFinished(), reportStarted()
+ \sa QFuture::isFinished(), QFuture::waitForFinished(), start()
*/
/*! \fn template<typename T> void QPromise<T>::suspendIfRequested()
@@ -206,7 +206,7 @@
Returns whether the computation has been cancelled with the
QFuture::cancel() function. The returned value \c true indicates that the
- computation should be finished and reportFinished() called.
+ computation should be finished and finish() called.
\note After cancellation, results currently available may still be accessed
by a future, but new results will not be added when calling addResult().
@@ -239,7 +239,7 @@
state.
\sa QFuture::progressValue(), QFuture::progressText(), QFuture::cancel(),
- reportFinished()
+ finish()
*/
/*! \fn template<typename T> void QPromise<T>::swap(QPromise<T> &other) noexcept