Fix deadlock when QQmlEngine is destroyed during compilation.
authorAndrew den Exter <andrew.den.exter@jollamobile.com>
Fri, 13 Dec 2013 06:10:58 +0000 (16:10 +1000)
committerThe Qt Project <gerrit-noreply@qt-project.org>
Thu, 19 Dec 2013 00:36:40 +0000 (01:36 +0100)
commit59396165f9efae042c6a5395cfbd3f861d12fbb5
tree5c96c1104581c1b935bb401812fdce3d6bdd15e7
parent854272ecf9f26e77ddd8e3b7015cb8fe278183a5
Fix deadlock when QQmlEngine is destroyed during compilation.

Before blocking to wait for the thread to finish ensure the thread
itself is not waiting for the main thread to complete some action
otherwise both threads will be waiting on the same wait condition that
neither is able to wake.  Likewise ensure the shutdown action is
processed if the last scheduled event is currently being processed.

Task-number: QTBUG-35581
Change-Id: I483fc56d0d398493f9fa907f3ab203439bfb9221
Reviewed-by: Robin Burchell <robin+qt@viroteck.net>
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
src/qml/qml/ftw/qqmlthread.cpp