QThread::isFinished should return true from finished()
authorOlivier Goffart <ogoffart@kde.org>
Thu, 3 Nov 2011 13:11:34 +0000 (14:11 +0100)
committerQt by Nokia <qt-info@nokia.com>
Thu, 3 Nov 2011 17:43:52 +0000 (18:43 +0100)
commitec5e59b73c20a7dc6aec96c829f1e53c3fa58c07
tree405d5403d5592aaedab91a22e648e7738c7d580f
parent1fe8fb81b14c4cf1f2515701055f2e03aabe271b
QThread::isFinished should return true from finished()

and isRunning() should return false.

This restore the Qt 4.7 behaviour

In Qt 4.7, the finished() was called with the thread's intenal mutex
locked. Which mean that:
 - Call to isRunning or isFinished called from a slot connected to
   finish within the thread would deadlock. (Hence no compatibility
   to keep here)
 - Call to isRunning or isFinished from a slot connected with
   QueuedConnection in another thread would lock the mutex until
   the destructors are finished. and then return as if the thread have
   finished.

Change-Id: I963eccae8f7634aff90cc4bbab6ca886a78e35eb
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
src/corelib/thread/qthread.cpp
tests/auto/corelib/thread/qthread/tst_qthread.cpp