qt5base-lts/tests/auto/corelib/thread/qfuturewatcher
Sona Kurazyan d7d6a1fe32 Don't queue events in QFutureWatcher when pause is requested
When QFutureWatcher (or QFutureInterface) is paused, it doesn't
mean that it will take effect immediately: the pending tasks may
still be in progress and keep reporting results. At the moment
QFutureWatcher will queue those events and report only with the
next resume. This behavior is wrong, QFutureWatcher should not
decide when to report events, the sender should decide when is the
right time. There's no benefit in reporting already happened events
with delay. Because of this, even the pause event itself was being
reported after resume.

Fixed the behavior by removing the logic of queueing events when
the state is set to "paused". It seems unlikely that the users of
QFutureWatcher rely on reporting events with delay.

[ChangeLog][Important Behavior Changes][QtCore] QFutureWatcher will not
immediately stop delivering progress and result ready signals when the
future is paused. At the moment of pausing there may be still computations
that are in progress and cannot be stopped. Signals for such computations
will be still delivered after pause, instead of being postponed and
reported only after next resume.

Fixes: QTBUG-12152
Change-Id: I9f0b545ac096578c52cc72d60575c018c01e3368
Reviewed-by: Jarek Kobus <jaroslaw.kobus@qt.io>
Reviewed-by: Leena Miettinen <riitta-leena.miettinen@qt.io>
2020-05-27 11:53:28 +02:00
..
.gitignore Move QFutureWatcher back to QtCore 2012-09-28 23:50:10 +02:00
CMakeLists.txt Regenerate projects one last time before merge 2020-02-12 17:30:49 +00:00
qfuturewatcher.pro Tests: Remove CONFIG += parallel_test. 2015-09-05 07:16:50 +00:00
tst_qfuturewatcher.cpp Don't queue events in QFutureWatcher when pause is requested 2020-05-27 11:53:28 +02:00