qt6-bb10/tests/auto/corelib/thread/qfuturewatcher
Jarek Kobus 63b2cf8a45 QFutureWatcher: Fix race for initial emission of resultReadyAt()
When connecting a QFutureWatcher to the QFuture it will connect to the
output interface, which will queue up events to notify about the current
state. This happens in the thread of the QFutureWatcher.

Since 07d6d31a4c unfortunately the sending
of those events was done outside the lock, meaning the worker-thread
could _also_ send events at the same time, leading to a race on which
events would be sent first.

To fix this we move the emission of the events back into the lock
and because it is now inside the lock again anyway, we will revert
back to posting the callout events immediately, so this patch also
partially reverts 07d6d31a4c

Fixes: QTBUG-119169
Pick-to: 6.7 6.6
Change-Id: If29ab6712a82e7948c0ea4866340b6fac5aba5ef
Reviewed-by: Arno Rehn <a.rehn@menlosystems.com>
Reviewed-by: Jarek Kobus <jaroslaw.kobus@qt.io>
2024-03-15 11:42:36 +00:00
..
.gitignore Move QFutureWatcher back to QtCore 2012-09-28 23:50:10 +02:00
CMakeLists.txt CMake: Make corelib tests standalone projects 2023-07-05 15:09:32 +02:00
tst_qfuturewatcher.cpp QFutureWatcher: Fix race for initial emission of resultReadyAt() 2024-03-15 11:42:36 +00:00