From 13370ead4e9184fd82c08c060dbb1ea29a51cc7c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jo=C3=A3o=20Abecasis?= Date: Mon, 10 Jan 2011 12:39:16 +0100 Subject: Fix reversed condition introduced in 9a6cfc07e5 Reviewed-by: Bradley T. Hughes --- src/corelib/thread/qsemaphore.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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; } -- cgit v0.12