Fix QMutex can deadlock when calling tryLock
authorOlivier Goffart <olivier.goffart@nokia.com>
Wed, 2 Feb 2011 10:31:20 +0000 (11:31 +0100)
committerOlivier Goffart <olivier.goffart@nokia.com>
Wed, 2 Feb 2011 12:36:41 +0000 (13:36 +0100)
commit7987d4cfd3ce86c20a55b5661a5221f12246b27e
tree9f9d3229c577be231b60d2f38ddfd58f8b0f0196
parent4d38013cfc3058e36de1b6a6c20653ef2688a92b
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
src/corelib/thread/qmutex_unix.cpp
tests/auto/qmutex/tst_qmutex.cpp