On Fri, Dec 28, 2012 at 08:13:37PM +0000, Blue Swirl wrote:
> On Fri, Dec 28, 2012 at 6:00 AM, Brad Smith <b...@comstyle.com> wrote:
> > 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.
> 
> Needs to be back ported to HEAD as well because of the reorganization,
> or applied after Paolo's series.
> 
> >
> > Signed-off-by: Paolo Bonzini <pbonz...@redhat.com>
> > Signed-off-by: Brad Smith <b...@comstyle.com>

Here is a patch applied to HEAD.


diff --git a/qemu-thread-posix.c b/qemu-thread-posix.c
index 6374df3..4489abf 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) {

-- 
This message has been scanned for viruses and
dangerous content by MailScanner, and is
believed to be clean.


Reply via email to