qt6-bb10/tests/auto/corelib
Arno Rehn 07d6d31a4c QFuture: Gracefully handle a destroyed context in continuations
This patch relaxes the requirements on the context object of
continuations. Instead of having to stay alive during execution of the
whole chain, it now only has to stay alive during setup of the chain.
If the context object is destroyed before the chain finishes, the
respective future is canceled.

This patch works by using QFutureCallOutInterface and signals instead
of direct invocation of the continuation by the parent future, similar
to how QFutureWatcher is implemented.
If a continuation is used with a context object, a QBasicFutureWatcher
is connected to the QFuture via a QFutureCallOutInterface. When the
future finishes, QBasicFutureWatcher::finished() triggers the
continuation with a signal/slot connection.
This way, we require the context object to stay alive only during setup;
the required synchronization is guaranteed by the existing event and
signal-slot mechanisms. The continuation itself does not need to know
about the context object anymore.

[ChangeLog][QtCore][QFuture] Added support for context objects of
continuations being destroyed before the continuation finishes. In
these cases the future is cancelled immediately.

Fixes: QTBUG-112958
Change-Id: Ie0ef3470b2a0ccfa789d2ae7604b92e509c14591
Reviewed-by: Ivan Solovev <ivan.solovev@qt.io>
2023-05-30 21:42:46 +02:00
..
animation QPauseAnimation test: add QNX to platforms that might fail 2023-05-25 14:06:50 +02:00
global Short live Q_NODISCARD_CTOR 2023-04-30 19:42:29 +02:00
io QProcess/Linux: add a flag to re-enable the vfork()-like semantics 2023-05-22 10:43:53 -07:00
ipc IPC: tst_QNativeIpcKey: rename duplicate row in test 2023-04-28 22:30:13 -05:00
itemmodels Remove unused variables 2023-04-19 12:55:02 +02:00
kernel Silence warning from unused variable in QObject test 2023-05-25 14:06:55 +02:00
mimetypes QMimeDatabase: de-duplicate some code in the unittests 2023-05-07 14:29:28 +03:00
platform tests: Remove remains of qmake conversion from CMakeLists.txt files 2023-02-17 21:56:49 +01:00
plugin QUuid: add support for 128-bit integers 2023-05-20 04:59:43 +00:00
serialization Shoehorn AccentColor into QPalette and keep existing 64bit resolve mask 2023-05-21 18:36:37 +02:00
text QRegularExpression: match newlines when converting wildcards 2023-05-23 00:03:37 +02:00
thread QFuture: Gracefully handle a destroyed context in continuations 2023-05-30 21:42:46 +02:00
time Add test-cases for QDate::{start,end}OfDay() at QDateTime's bounds 2023-05-15 14:02:41 +02:00
tools QVarLengthArray/QList: make assign() return a reference to *this 2023-05-17 06:44:45 +02:00
CMakeLists.txt tests: Remove remains of qmake conversion from CMakeLists.txt files 2023-02-17 21:56:49 +01:00