diff --git a/src/libs/utils/runextensions.h b/src/libs/utils/runextensions.h index 82854abd731..af174a32e26 100644 --- a/src/libs/utils/runextensions.h +++ b/src/libs/utils/runextensions.h @@ -512,7 +512,6 @@ void blockingMapReduce(QFutureInterface futureInterface, const Con const ReduceFunction &reduce, const CleanUpFunction &cleanup) { auto state = init(futureInterface); - futureInterface.reportStarted(); mapReduceLoop(futureInterface, container, map, state, reduce); cleanup(futureInterface, state); if (futureInterface.isPaused()) @@ -523,7 +522,6 @@ void blockingMapReduce(QFutureInterface futureInterface, const Con template void runAsyncImpl(QFutureInterface futureInterface, const Function &function, const Args&... args) { - futureInterface.reportStarted(); function(futureInterface, args...); if (futureInterface.isPaused()) futureInterface.waitForResume(); @@ -540,6 +538,7 @@ QFuture mapReduce(std::reference_wrapper containerWrapp { auto fi = QFutureInterface(); QFuture future = fi.future(); + fi.reportStarted(); std::thread(Internal::blockingMapReduce, fi, containerWrapper, init, map, reduce, cleanup).detach(); return future; @@ -561,6 +560,7 @@ template QFuture runAsync(Function &&function, Args&&... args) { QFutureInterface futureInterface; + futureInterface.reportStarted(); std::thread(Internal::runAsyncImpl, futureInterface, std::forward(function), std::forward(args)...).detach(); return futureInterface.future();