From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:54992) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ToSzq-0007LC-4w for qemu-devel@nongnu.org; Fri, 28 Dec 2012 01:00:43 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ToSzo-00028S-Vp for qemu-devel@nongnu.org; Fri, 28 Dec 2012 01:00:42 -0500 Received: from speedy.comstyle.com ([2001:470:1d:8c::2]:26779 helo=mail.comstyle.com) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ToSzo-00020j-S6 for qemu-devel@nongnu.org; Fri, 28 Dec 2012 01:00:40 -0500 Received: from rox.home.comstyle.com (unknown [IPv6:2001:470:b01e:3:74db:fa43:e58b:905c]) (using TLSv1 with cipher ECDHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) (Authenticated sender: brad) by mail.comstyle.com (Postfix) with ESMTPSA id 9C91729744 for ; Fri, 28 Dec 2012 01:00:27 -0500 (EST) Date: Fri, 28 Dec 2012 01:00:26 -0500 From: Brad Smith Message-ID: <20121228060022.GB27232@rox.home.comstyle.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Subject: [Qemu-devel] [PATCH] Fix semaphores fallback code List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org As reported in bug 1087114 the semaphores fallback code is broken which results in QEMU crashing and making QEMU unusable. This patch is from Paolo. This needs to be back ported to the 1.3 stable tree as well. Signed-off-by: Paolo Bonzini Signed-off-by: Brad Smith diff --git a/util/qemu-thread-posix.c b/util/qemu-thread-posix.c index 7be292e..17f2d7c 100644 --- a/util/qemu-thread-posix.c +++ b/util/qemu-thread-posix.c @@ -213,6 +213,7 @@ int qemu_sem_timedwait(QemuSemaphore *sem, int ms) while (sem->count < 0) { rc = pthread_cond_timedwait(&sem->cond, &sem->lock, &ts); if (rc == ETIMEDOUT) { + ++sem->count; break; } if (rc != 0) { -- This message has been scanned for viruses and dangerous content by MailScanner, and is believed to be clean.