From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1Lakit-0000em-8Y for qemu-devel@nongnu.org; Sat, 21 Feb 2009 00:48:23 -0500 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1Lakis-0000e7-Gy for qemu-devel@nongnu.org; Sat, 21 Feb 2009 00:48:22 -0500 Received: from [199.232.76.173] (port=55317 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Lakir-0000di-CL for qemu-devel@nongnu.org; Sat, 21 Feb 2009 00:48:21 -0500 Received: from savannah.gnu.org ([199.232.41.3]:33734 helo=sv.gnu.org) by monty-python.gnu.org with esmtps (TLS-1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1Lakiq-0006qO-Sp for qemu-devel@nongnu.org; Sat, 21 Feb 2009 00:48:20 -0500 Received: from cvs.savannah.gnu.org ([199.232.41.69]) by sv.gnu.org with esmtp (Exim 4.63) (envelope-from ) id 1Lakiq-0006NO-D2 for qemu-devel@nongnu.org; Sat, 21 Feb 2009 05:48:20 +0000 Received: from malc by cvs.savannah.gnu.org with local (Exim 4.63) (envelope-from ) id 1Lakiq-0006NK-3n for qemu-devel@nongnu.org; Sat, 21 Feb 2009 05:48:20 +0000 MIME-Version: 1.0 Errors-To: malc Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit From: malc Message-Id: Date: Sat, 21 Feb 2009 05:48:20 +0000 Subject: [Qemu-devel] [6634] Properly handle pthread_cond_timedwait timing out Reply-To: qemu-devel@nongnu.org List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org 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);