qt5base-lts/tests/auto
Kent Hansen f9a17d7f0f statemachine: Fix signal transition handling in multi-threaded setup
By default, QStateMachine lazily registers signal transitions (i.e.,
connects to the signal) when the transition's source state is
entered. The connections are established in Qt::AutoConnection mode,
which means that if the sender object lives in a different thread,
the signal processing will be queued.

But if a sender object's signal is used in an out-going transition
of the target state of the queued transition, it's possible that a
second signal emission on the sender object's thread will be
"missed" by the state machine; before the machine gets around to
processing the first queued emission (and registering the
transitions of the new state), a sender object on the other thread
could have emitted a new signal.

The solution employed here is to eagerly register any signal
transition whose sender object is on a different thread; that is,
register it regardless of whether the transition's source state is
active.

Conversely, when a machine's transitions are unregistered (i.e.,
because the machine finished), signal transitions with sender
objects on other threads should be left as-is, in case the machine
will be run again.

This doesn't solve the case where the sender object is moved to a
different thread _after_ the transition has been initialized.
Theoretically, we could catch that by installing an event filter
on every sender object and handle the ThreadChange events, but
that would be very expensive, and likely useless in most cases.
So let's just say that that case isn't supported for now.

Task-number: QTBUG-19789
Change-Id: Ibc87bfbf2ed83217ac61ae9401fe4f179ef26c24
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@nokia.com>
2012-07-13 12:09:42 +02:00
..
cmake Fix unit tests when CMAKE_PREFIX_PATH env var is not set. 2012-07-11 12:46:15 +02:00
compilerwarnings/data Remove "All rights reserved" line from license headers. 2012-01-30 03:54:59 +01:00
concurrent Remove insignification from QtConcurrentFilter test. 2012-04-19 13:26:51 +02:00
corelib statemachine: Fix signal transition handling in multi-threaded setup 2012-07-13 12:09:42 +02:00
dbus Make test work on Mac OS X 2012-06-23 16:25:47 +02:00
gui Fix crash when column is inserted before rowspanned cell 2012-07-12 18:29:25 +02:00
guiapplauncher Update the documentation after moving examples. 2011-07-05 21:19:08 +02:00
network Fix some spelling errors 2012-07-11 14:52:37 +02:00
opengl Mark qgl autotest as significant for Windows 2012-07-03 00:51:44 +02:00
other Remove clipboard operations from QAccessibleEditableTextInterface 2012-07-11 02:47:34 +02:00
printsupport Replace insignificant test with QEXPECT_FAIL. 2012-07-05 05:39:12 +02:00
shared Expose QPA API under qpa/* 2012-05-07 20:25:24 +02:00
sql Make sql autotests build without widgets 2012-06-07 07:25:27 +02:00
testlib Avoid load(testcase) for installing test helper apps 2012-07-04 02:46:27 +02:00
tools Create a way to inform moc about private signals. 2012-07-13 01:51:42 +02:00
widgets Implement qWaitForWindowShown using qWaitForWindowExposed. 2012-07-12 14:22:48 +02:00
xml remove some qmake -project boilerplate from project files 2012-06-19 16:39:52 +02:00
auto.pro Tests: Fix printsupport profiles. 2012-07-12 11:15:58 +02:00
network-settings.h Fix auto tests build with gcc 4.7 2012-05-23 00:42:20 +02:00
platformquirks.h Remove "All rights reserved" line from license headers. 2012-01-30 03:54:59 +01:00
test.pl Remove "All rights reserved" line from license headers. 2012-01-30 03:54:59 +01:00