Suppose you started a local run of a QEventLoop in some thread:
and you want to exit it from a different thread like this:
// thread2 gets a reference to the loop variable somehow
then the loop does not always exit.
The issue seems to be caused by the fact that the interrupt variable in QEventDispatcherWin32Private is a normal bool and not an atomic.
The change of the Boolean to false by the interrupt() call by QEventLoop::exit() is not always seen by the thread running the loop.
The same member has been turned into a QAtomicInt in QEventDispatcherUNIXPrivate by the following commit:
|For Gerrit Dashboard: QTBUG-72438|
|247831,3||Make the QEventDispatcherWin32Private::interrupt flag atomic||5.12||qt/qtbase||Status: MERGED||+2||0|