qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [Qemu-devel] [6634] Properly handle pthread_cond_timedwait timing out
@ 2009-02-21  5:48 malc
  0 siblings, 0 replies; only message in thread
From: malc @ 2009-02-21  5:48 UTC (permalink / raw)
  To: qemu-devel

Revision: 6634
          http://svn.sv.gnu.org/viewvc/?view=rev&root=qemu&revision=6634
Author:   malc
Date:     2009-02-21 05:48:19 +0000 (Sat, 21 Feb 2009)

Log Message:
-----------
Properly handle pthread_cond_timedwait timing out

pthread_cond_timedwait is allowed to both consume the signal and
return with the value indicating the timeout, hence predicate should
always be (re)checked before taking an action

Modified Paths:
--------------
    trunk/posix-aio-compat.c

Modified: trunk/posix-aio-compat.c
===================================================================
--- trunk/posix-aio-compat.c	2009-02-21 05:48:17 UTC (rev 6633)
+++ trunk/posix-aio-compat.c	2009-02-21 05:48:19 UTC (rev 6634)
@@ -104,7 +104,7 @@
             ret = cond_timedwait(&cond, &lock, &ts);
         }
 
-        if (ret == ETIMEDOUT)
+        if (TAILQ_EMPTY(&request_list))
             break;
 
         aiocb = TAILQ_FIRST(&request_list);

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2009-02-21  5:48 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-02-21  5:48 [Qemu-devel] [6634] Properly handle pthread_cond_timedwait timing out malc

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).