From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:47900) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TvWBq-00056I-6K for qemu-devel@nongnu.org; Wed, 16 Jan 2013 11:50:15 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1TvWBo-0005iP-1j for qemu-devel@nongnu.org; Wed, 16 Jan 2013 11:50:13 -0500 Sender: fluxion From: Michael Roth Date: Wed, 16 Jan 2013 10:49:03 -0600 Message-Id: <1358354963-9070-2-git-send-email-mdroth@linux.vnet.ibm.com> In-Reply-To: <1358354963-9070-1-git-send-email-mdroth@linux.vnet.ibm.com> References: <1358354963-9070-1-git-send-email-mdroth@linux.vnet.ibm.com> Subject: [Qemu-devel] [PATCH 01/21] Fix semaphores fallback code List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: aliguori@us.ibm.com, qemu-stable@nongnu.org From: Brad Smith 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 Signed-off-by: Blue Swirl (cherry picked from commit a795ef8dcb8cbadffc996c41ff38927a97645234) Signed-off-by: Michael Roth --- qemu-thread-posix.c | 1 + 1 file changed, 1 insertion(+) diff --git a/qemu-thread-posix.c b/qemu-thread-posix.c index 4ef9c7b..9a3885f 100644 --- a/qemu-thread-posix.c +++ b/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) { -- 1.7.9.5