[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH 02/21] Disable semaphores fallback code for OpenBSD
From: |
Michael Roth |
Subject: |
[Qemu-devel] [PATCH 02/21] Disable semaphores fallback code for OpenBSD |
Date: |
Wed, 16 Jan 2013 10:49:04 -0600 |
From: Brad Smith <address@hidden>
Disable the semaphores fallback code for OpenBSD as modern OpenBSD
releases now have sem_timedwait().
Signed-off-by: Brad Smith <address@hidden>
Signed-off-by: Blue Swirl <address@hidden>
(cherry picked from commit 927fa909d5d5cf8c07673cd16a6d3bdc81250bc0)
Signed-off-by: Michael Roth <address@hidden>
---
qemu-thread-posix.c | 10 +++++-----
qemu-thread-posix.h | 2 +-
2 files changed, 6 insertions(+), 6 deletions(-)
diff --git a/qemu-thread-posix.c b/qemu-thread-posix.c
index 9a3885f..e24e2ae 100644
--- a/qemu-thread-posix.c
+++ b/qemu-thread-posix.c
@@ -122,7 +122,7 @@ void qemu_sem_init(QemuSemaphore *sem, int init)
{
int rc;
-#if defined(__OpenBSD__) || defined(__APPLE__) || defined(__NetBSD__)
+#if defined(__APPLE__) || defined(__NetBSD__)
rc = pthread_mutex_init(&sem->lock, NULL);
if (rc != 0) {
error_exit(rc, __func__);
@@ -147,7 +147,7 @@ void qemu_sem_destroy(QemuSemaphore *sem)
{
int rc;
-#if defined(__OpenBSD__) || defined(__APPLE__) || defined(__NetBSD__)
+#if defined(__APPLE__) || defined(__NetBSD__)
rc = pthread_cond_destroy(&sem->cond);
if (rc < 0) {
error_exit(rc, __func__);
@@ -168,7 +168,7 @@ void qemu_sem_post(QemuSemaphore *sem)
{
int rc;
-#if defined(__OpenBSD__) || defined(__APPLE__) || defined(__NetBSD__)
+#if defined(__APPLE__) || defined(__NetBSD__)
pthread_mutex_lock(&sem->lock);
if (sem->count == INT_MAX) {
rc = EINVAL;
@@ -206,7 +206,7 @@ int qemu_sem_timedwait(QemuSemaphore *sem, int ms)
int rc;
struct timespec ts;
-#if defined(__OpenBSD__) || defined(__APPLE__) || defined(__NetBSD__)
+#if defined(__APPLE__) || defined(__NetBSD__)
compute_abs_deadline(&ts, ms);
pthread_mutex_lock(&sem->lock);
--sem->count;
@@ -249,7 +249,7 @@ int qemu_sem_timedwait(QemuSemaphore *sem, int ms)
void qemu_sem_wait(QemuSemaphore *sem)
{
-#if defined(__OpenBSD__) || defined(__APPLE__) || defined(__NetBSD__)
+#if defined(__APPLE__) || defined(__NetBSD__)
pthread_mutex_lock(&sem->lock);
--sem->count;
while (sem->count < 0) {
diff --git a/qemu-thread-posix.h b/qemu-thread-posix.h
index 380bae2..0f30dcc 100644
--- a/qemu-thread-posix.h
+++ b/qemu-thread-posix.h
@@ -12,7 +12,7 @@ struct QemuCond {
};
struct QemuSemaphore {
-#if defined(__OpenBSD__) || defined(__APPLE__) || defined(__NetBSD__)
+#if defined(__APPLE__) || defined(__NetBSD__)
pthread_mutex_t lock;
pthread_cond_t cond;
int count;
--
1.7.9.5
- [Qemu-devel] Patch Round-up for stable 1.3.1, freeze Monday, Michael Roth, 2013/01/16
- [Qemu-devel] [PATCH 01/21] Fix semaphores fallback code, Michael Roth, 2013/01/16
- [Qemu-devel] [PATCH 02/21] Disable semaphores fallback code for OpenBSD,
Michael Roth <=
- [Qemu-devel] [PATCH 03/21] Fix off-by-1 error in RAM migration code, Michael Roth, 2013/01/16
- [Qemu-devel] [PATCH 04/21] migration: Fix madvise breakage if host and guest have different page sizes, Michael Roth, 2013/01/16
- [Qemu-devel] [PATCH 05/21] target-mips: Fix incorrect code and test for INSV, Michael Roth, 2013/01/16
- [Qemu-devel] [PATCH 06/21] target-mips: Fix incorrect shift for SHILO and SHILOV, Michael Roth, 2013/01/16
- [Qemu-devel] [PATCH 07/21] vfio-pci: Don't use kvm_irqchip_in_kernel, Michael Roth, 2013/01/16
- [Qemu-devel] [PATCH 11/21] target-xtensa: fix ITLB/DTLB page protection flags, Michael Roth, 2013/01/16
- [Qemu-devel] [PATCH 12/21] qxl: save qemu_create_displaysurface_from result, Michael Roth, 2013/01/16
- [Qemu-devel] [PATCH 10/21] pixman: fix vnc tight png/jpeg support, Michael Roth, 2013/01/16
- [Qemu-devel] [PATCH 08/21] seabios: update to e8a76b0f225bba5ba9d63ab227e0a37b3beb1059, Michael Roth, 2013/01/16
- [Qemu-devel] [PATCH 13/21] qxl+vnc: register a vm state change handler for dummy spice_server, Michael Roth, 2013/01/16