statemachine: Really fix signal transition handling in multi-threaded setup
authorKent Hansen <kent.hansen@nokia.com>
Wed, 1 Aug 2012 10:59:28 +0000 (12:59 +0200)
committerQt by Nokia <qt-info@nokia.com>
Wed, 8 Aug 2012 12:13:53 +0000 (14:13 +0200)
commit8efcfda41f98af51c5d7ab72b5bc38926e9c3f11
treee57f2ba371efb37a302f6113d7a89fe77869967f
parentf7272b4587a4a0a44fcf36a3c1e163f8040a2d48
statemachine: Really fix signal transition handling in multi-threaded setup

Commit f9a17d7f0f02f7af849afdf653a763ffdaf78a1b fixed it for the case
where the sender object is in a different thread at transition setup
time. However, it still didn't work if either the sender object or the
state machine was moved to a different thread at some later time,
before the machine was started.

Therefore: Bite the sour grape and traverse all the machine's
transitions when the machine is being started, registering those
signal transitions whose sender objects are in other threads.

This will increase the machine's startup time (proportional to the
number of transitions), but at least it works in all known scenarios,
meaning we don't have to document weird restrictions regarding the
order in which the user's operations have to be done.

Task-number: QTBUG-19789
Change-Id: I5f1dd1321994e49635f52be65cf56d2678ed1253
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@nokia.com>
src/corelib/statemachine/qstatemachine.cpp
src/corelib/statemachine/qstatemachine_p.h
tests/auto/corelib/statemachine/qstatemachine/tst_qstatemachine.cpp