qt5base-lts/tests/auto
Mårten Nordheim f274f91ceb QEventDispatcher(Win): Always honor interrupted status to avoid races
There may be a race where e.g. thread 'B' is woken up by a queued invoke.
At the same time thread 'A' asks 'B' to quit, which will set various
atomics (some important ones are 'interrupt' in the dispatcher and
'exit' in the event loop), but it does _not_ try to send another wake
since there is already an unhandled wake triggered by 'B' itself.
Sadly 'B' reads the 'exit' atomic before 'A' updates it.
Then, slightly before, 'B' sets 'interrupt' back to 0, 'A' write 1 to
it, meaning 'A's interrupt is ignored. Then, since there is no
interrupt, 'B' goes back to waiting for events, leaving the thread alive
and running instead of quitting.

Maybe this has unforeseen consequences (one consequence is that it will
return and re-enter the event dispatcher once more, possible
unnecessarily)

Fixes: QTBUG-91539
Pick-to: 6.1 6.0 5.15
Change-Id: Ie6f861f42ffddf4817d5c8af2d764abe9d9103c2
Reviewed-by: Alex Trotsenko <alex1973tr@gmail.com>
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2021-03-11 12:11:18 +01:00
..
cmake Fix qt_add_big_resources with namespace builds 2021-01-19 14:17:55 +01:00
concurrent Fix a few compiler warnings in tests 2021-02-02 12:06:05 +01:00
corelib QEventDispatcher(Win): Always honor interrupted status to avoid races 2021-03-11 12:11:18 +01:00
dbus dbus: Fix missing QVersionNumber include 2021-01-25 12:09:17 +01:00
gui Make tst_shortcut pass on Wayland 2021-03-11 11:59:14 +01:00
guiapplauncher Move QStateMachine from QtCore to QtScxml 2020-08-24 20:10:25 +02:00
network Fix a BIC introduced by extending the namespace QSsl in _p.h files 2021-03-05 20:50:02 +00:00
opengl Remove the qmake project files 2021-01-07 15:32:28 +01:00
other Move QEMU emulation detector to QTest 2021-02-13 10:02:51 +02:00
printsupport Remove the qmake project files 2021-01-07 15:32:28 +01:00
shared Remove false Q_UNREACHABLE from shaping code 2021-02-03 09:44:44 +01:00
sql Fix a few compiler warnings in tests 2021-02-02 12:06:05 +01:00
testlib Fix testlib/tst_selftests::keyboard on Wayland 2021-03-09 07:42:50 +01:00
tools Move build tools to libexec instead of the bin dir 2021-02-23 17:02:30 +01:00
widgets Fix tst_QDialog::keepPositionOnClose on Wayland 2021-03-11 11:59:02 +01:00
xml tst_qdom: clean-up the code enabled only before Qt 6 2021-01-15 15:22:08 +01:00
CMakeLists.txt CMake: Fix building with -DQT_FEATURE_gui=OFF 2020-09-15 20:05:32 +02:00
network-settings.h Replace QtTest headers with QTest 2020-12-22 15:20:30 +01:00