qt5base-lts/tests/auto/corelib
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
..
animation Port QPauseAnimation to the new property system 2021-01-26 21:47:47 +01:00
global Skip globalstatic threadStressTest on QEMU 2021-03-05 08:09:59 +00:00
io QProcess/Unix: remove outdated notices about use of posix_spawn() on QNX 2021-02-21 22:48:38 -08:00
itemmodels QConcatenateTablesProxyModel: skip dataChanged in hidden columns 2021-03-09 13:39:45 +01:00
kernel QEventDispatcher(Win): Always honor interrupted status to avoid races 2021-03-11 12:11:18 +01:00
mimetypes Remove .prev_CMakeLists.txt files 2021-01-12 20:59:13 +01:00
plugin Remove .prev_CMakeLists.txt files 2021-01-12 20:59:13 +01:00
serialization QJsonObject: Fix operator<=() 2021-02-18 11:22:51 +00:00
text macOS: Be honest about the system locale 2021-02-11 15:01:45 +01:00
thread Fix warning about virtual override 2021-03-05 15:51:41 +01:00
time Add more QDateTime test-cases close to the epoch 2021-03-05 16:11:26 +01:00
tools QCommandLineParser: fix crash if there's no QCoreApplication 2021-03-01 23:03:00 +01:00
CMakeLists.txt Move QStateMachine from QtCore to QtScxml 2020-08-24 20:10:25 +02:00