diff options
author | João Abecasis <joao.abecasis@nokia.com> | 2011-01-10 11:39:16 (GMT) |
---|---|---|
committer | João Abecasis <joao.abecasis@nokia.com> | 2011-01-10 11:52:52 (GMT) |
commit | 13370ead4e9184fd82c08c060dbb1ea29a51cc7c (patch) | |
tree | e6bde8c1c0c571cda85f9902ffde89a66a7c0351 | |
parent | b8dcbb9dc467bfd792828c27d49232abff062580 (diff) | |
download | Qt-13370ead4e9184fd82c08c060dbb1ea29a51cc7c.zip Qt-13370ead4e9184fd82c08c060dbb1ea29a51cc7c.tar.gz Qt-13370ead4e9184fd82c08c060dbb1ea29a51cc7c.tar.bz2 |
Fix reversed condition introduced in 9a6cfc07e5
Reviewed-by: Bradley T. Hughes
-rw-r--r-- | src/corelib/thread/qsemaphore.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/corelib/thread/qsemaphore.cpp b/src/corelib/thread/qsemaphore.cpp index 15f45b6..5fa41f1 100644 --- a/src/corelib/thread/qsemaphore.cpp +++ b/src/corelib/thread/qsemaphore.cpp @@ -224,7 +224,7 @@ bool QSemaphore::tryAcquire(int n, int timeout) timer.start(); while (n > d->avail) { const qint64 elapsed = timer.elapsed(); - if (timeout - elapsed > 0 + if (timeout - elapsed <= 0 || !d->cond.wait(locker.mutex(), timeout - elapsed)) return false; } |