From 37cfc3c6d2e3b290c7fc41cd7545283d24e4433c Mon Sep 17 00:00:00 2001 From: Sona Kurazyan Date: Tue, 2 Jun 2020 10:48:06 +0200 Subject: Deprecate the pause-related APIs of QFuture* classes MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Deprecated the pause-related APIs of QFuture* classes and added alternatives having "suspend" in the name instead. With 2f15927f01ceef0aca490746302a5ea57ea9441c new isSuspended()/suspended() APIs have been added to QFuture* classes for checking if pause/suspension is still in progress or it already took effect. To keep the naming more consistent, renamed: - setPaused() -> setSuspended() - pause() -> suspend() - togglePaused() -> toggleSuspended() - QFutureWatcher::paused() -> QFutureWatcher::suspending() Note that QFuture*::isPaused() now corresponds to (isSuspending() || isSuspended()). [ChangeLog][Deprecation Notice] Deprecated pause-related APIs of QFuture and QFutureWatcher. Added alternatives having "suspend" in the name instead. Change-Id: Ibeb75017a118401d64d18b72fb95d78e28c4661c Reviewed-by: MÃ¥rten Nordheim Reviewed-by: Leena Miettinen Reviewed-by: Andrei Golubev Reviewed-by: Jarek Kobus --- src/concurrent/qtconcurrentthreadengine.cpp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'src/concurrent/qtconcurrentthreadengine.cpp') diff --git a/src/concurrent/qtconcurrentthreadengine.cpp b/src/concurrent/qtconcurrentthreadengine.cpp index 7ea606f60b2..2c6e0526211 100644 --- a/src/concurrent/qtconcurrentthreadengine.cpp +++ b/src/concurrent/qtconcurrentthreadengine.cpp @@ -219,9 +219,9 @@ void ThreadEngineBase::acquireBarrierSemaphore() barrier.acquire(); } -void ThreadEngineBase::reportIfPausedDone() const +void ThreadEngineBase::reportIfSuspensionDone() const { - if (futureInterface && futureInterface->isPaused()) + if (futureInterface && futureInterface->isSuspending()) futureInterface->reportSuspended(); } @@ -313,11 +313,11 @@ void ThreadEngineBase::run() // implements QRunnable. if (threadThrottleExit()) { return; } else { - // If the last worker thread is throttled and the state is paused, - // it means that pause has been requested, and it is already + // If the last worker thread is throttled and the state is "suspending", + // it means that suspension has been requested, and it is already // in effect (because all previous threads have already exited). // Report the "Suspended" state. - reportIfPausedDone(); + reportIfSuspensionDone(); } } -- cgit v1.2.3