qt6-bb10/tests/auto/corelib/kernel
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
..
qcoreapplication Remove .prev_CMakeLists.txt files 2021-01-12 20:59:13 +01:00
qdeadlinetimer Remove the qmake project files 2021-01-07 15:32:28 +01:00
qelapsedtimer Remove the qmake project files 2021-01-07 15:32:28 +01:00
qeventdispatcher QEventDispatcher(Win): Always honor interrupted status to avoid races 2021-03-11 12:11:18 +01:00
qeventloop Remove the qmake project files 2021-01-07 15:32:28 +01:00
qjnienvironment Fix registerNativeMethods for good 2021-02-11 14:03:50 +00:00
qjniobject Make QJniObject and QJniEnvironment public API 2021-01-27 17:23:04 +02:00
qmath Add qHypot() to qmath.h, exposing and extending std::hypot() 2021-01-27 15:00:57 +01:00
qmetacontainer Remove the qmake project files 2021-01-07 15:32:28 +01:00
qmetaenum Remove the qmake project files 2021-01-07 15:32:28 +01:00
qmetamethod Remove the qmake project files 2021-01-07 15:32:28 +01:00
qmetaobject Remove the qmake project files 2021-01-07 15:32:28 +01:00
qmetaobjectbuilder Remove the qmake project files 2021-01-07 15:32:28 +01:00
qmetaproperty Remove the qmake project files 2021-01-07 15:32:28 +01:00
qmetatype tst_qmetatype: RELOCATABLE -> PRIMITIVE is binary compatible 2021-03-05 10:19:45 +00:00
qmimedata Remove the qmake project files 2021-01-07 15:32:28 +01:00
qobject Add new special QObjectPrivate::{connect, disconnect} for QML 2021-01-18 15:54:03 +01:00
qpointer Remove the qmake project files 2021-01-07 15:32:28 +01:00
qproperty Remove QObjectCompatProperty::operator= for safer usage 2021-01-29 16:06:19 +01:00
qsharedmemory Remove .prev_CMakeLists.txt files 2021-01-12 20:59:13 +01:00
qsignalblocker Remove the qmake project files 2021-01-07 15:32:28 +01:00
qsignalmapper Remove the qmake project files 2021-01-07 15:32:28 +01:00
qsocketnotifier tst_socketnotifier: Fix timeout of QTcpServer::waitForNewConnection() 2021-01-21 08:53:35 +00:00
qsystemsemaphore Remove the qmake project files 2021-01-07 15:32:28 +01:00
qtimer Fix QTimer::setInterval to remove existing bindings 2021-02-15 13:47:31 +01:00
qtranslator Remove the qmake project files 2021-01-07 15:32:28 +01:00
qvariant QMetaType: Store QMetaObject for pointer to const QObject, too 2021-02-26 09:10:31 +01:00
qwineventnotifier Remove the qmake project files 2021-01-07 15:32:28 +01:00
CMakeLists.txt Make QJniObject and QJniEnvironment public API 2021-01-27 17:23:04 +02:00