qt6-bb10/tests/auto/corelib
Arno Rehn 59e21a536f QFuture: Don't use QFutureCallOutInterface for continuations
This patch replaces the QBasicFutureWatcher that was used for
continuations with context objects with a smaller QObject-based wrapper
that works directly from the actual continuation.
The idea stays the same: In order to run continuations in the thread of
a context object, we offload the continuation invocation to the
signal-slot mechanism.
Previously, we've hooked into QFuture with QFutureCallOutInterface to
emit a signal and trigger continuation invocation. However, it is much
easier and robust to emit that signal from the continuation itself.

This sidesteps the locking issues that QFutureCallOutInterface handling
presents. QFutureCallOutInterface basically requires any consumer to
only access the QFuture after all events have been posted and the
internal mutex unlocked, i.e. on the next cycle of the event loop.

Continuations do not impose this restriction; runContinuation()
explicitly unlocks the internal mutex before calling the continuation.

This fixes a deadlock when using QFuture::then(context, ...) where
the paren future is resolved from the same thread that the context
object lives in.

Fixes: QTBUG-119406
Fixes: QTBUG-119103
Fixes: QTBUG-117918
Fixes: QTBUG-119579
Fixes: QTBUG-119810
Pick-to: 6.7 6.6
Change-Id: I112b16024cde6b6ee0e4d8127392864b813df5bc
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Ivan Solovev <ivan.solovev@qt.io>
2023-12-13 21:54:00 +01:00
..
animation Tests: remove blacklisted CIs no longer available 2023-12-06 22:07:44 +01:00
global tst_QtEndian: rewrite the ENDIAN_TEST macros to support FP 2023-12-11 23:40:04 +01:00
io Tests: remove blacklisted CIs no longer available 2023-12-06 22:07:44 +01:00
ipc QSharedMemory: fix attach() -> create() for non-legacy SystemV mode 2023-11-08 15:56:54 +01:00
itemmodels Q(Persistent)ModelIndex: use new test framework for op== 2023-11-13 17:35:54 +02:00
kernel QProperty: clean up unnecessary sentinel class 2023-12-09 08:37:44 +08:00
mimetypes Long live QSpan as public API! 2023-12-07 22:38:15 +00:00
platform Android: fix and simplify the orientation change logic 2023-12-05 16:28:12 +00:00
plugin tst_QUuid: use int128 literals and QCOMPARE support 2023-12-09 21:00:16 +01:00
serialization Tests: remove blacklisted CIs no longer available 2023-12-06 22:07:44 +01:00
text tst_QString: explain TransientDefaultLocale better 2023-12-07 23:55:08 +01:00
thread QFuture: Don't use QFutureCallOutInterface for continuations 2023-12-13 21:54:00 +01:00
time Give the caller control over the century used for two-digit dates 2023-12-08 11:40:36 +01:00
tools QBitArray: add rvalue binary bitwise operators 2023-12-12 22:59:23 -08:00
CMakeLists.txt tests: Remove remains of qmake conversion from CMakeLists.txt files 2023-02-17 21:56:49 +01:00