Fix QMutex can deadlock when calling tryLock
authorOlivier Goffart <olivier.goffart@nokia.com>
Wed, 2 Feb 2011 10:31:20 +0000 (11:31 +0100)
committerJason McDonald <jason.mcdonald@nokia.com>
Thu, 3 Feb 2011 09:32:29 +0000 (19:32 +1000)
commitb6525589d82098e5e83fae44a050751da71a33ed
treeff66fc0948f6435aac548b9d208c06a39de5e083
parent94c2723da7bd0af72a1dc6228f8029fa7bb239b7
Fix QMutex can deadlock when calling tryLock

in the unix code, if the QMutexPrivate::wait() with a timeout
expires in the same moment that the mutex is released,  wakeup
would be set, but would be then ignored. (reset to false
quickly after)

If we waken up between the timeout and the re-aquisition of
the internal mutex, we consider that the mutex has been locked.

Reviewed-by: brad
Task-number: QTBUG-16115
(cherry picked from commit 7987d4cfd3ce86c20a55b5661a5221f12246b27e)
src/corelib/thread/qmutex_unix.cpp
tests/auto/qmutex/tst_qmutex.cpp