Skip to content

Commit

Permalink
Fix semaphores fallback code
Browse files Browse the repository at this point in the history
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 <pbonzini@redhat.com>
Signed-off-by: Brad Smith <brad@comstyle.com>
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
  • Loading branch information
brad0 authored and blueswirl committed Dec 29, 2012
1 parent 753d99d commit a795ef8
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions qemu-thread-posix.c
Expand Up @@ -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) {
Expand Down

0 comments on commit a795ef8

Please sign in to comment.