diff --git a/src/corelib/thread/qfuture_impl.h b/src/corelib/thread/qfuture_impl.h index 869a791b15d..fa2385e1805 100644 --- a/src/corelib/thread/qfuture_impl.h +++ b/src/corelib/thread/qfuture_impl.h @@ -1040,13 +1040,13 @@ struct WhenAllContext futures[index] = std::forward(future); Q_ASSERT(count > 0); if (--count <= 0) { - promise.reportResult(futures); - promise.reportFinished(); + promise.addResult(futures); + promise.finish(); } } QAtomicInteger count; - QFutureInterface promise; + QPromise promise; ResultFutures futures; }; @@ -1059,13 +1059,13 @@ struct WhenAnyContext void checkForCompletion(qsizetype, T &&result) { if (!ready.fetchAndStoreRelaxed(true)) { - promise.reportResult(std::forward(result)); - promise.reportFinished(); + promise.addResult(std::forward(result)); + promise.finish(); } } QAtomicInt ready = false; - QFutureInterface promise; + QPromise promise; }; template @@ -1100,7 +1100,7 @@ QFuture whenAllImpl(InputIt first, InputIt last) auto context = QSharedPointer>::create(size); context->futures.resize(size); - context->promise.reportStarted(); + context->promise.start(); qsizetype idx = 0; for (auto it = first; it != last; ++it, ++idx) { @@ -1119,7 +1119,7 @@ QFuture whenAllImpl(Futures &&... futures) constexpr qsizetype size = sizeof...(Futures); auto context = QSharedPointer>::create(size); context->futures.resize(size); - context->promise.reportStarted(); + context->promise.start(); QtPrivate::addCompletionHandlers(context, std::make_tuple(std::forward(futures)...)); @@ -1140,7 +1140,7 @@ QFuture::type>> whenAnyImpl(I } auto context = QSharedPointer>::create(); - context->promise.reportStarted(); + context->promise.start(); qsizetype idx = 0; for (auto it = first; it != last; ++it, ++idx) { @@ -1159,7 +1159,7 @@ QFuture...>> whenAnyImpl(Futures &&... future using ResultType = std::variant...>; auto context = QSharedPointer>::create(); - context->promise.reportStarted(); + context->promise.start(); QtPrivate::addCompletionHandlers(context, std::make_tuple(std::forward(futures)...));