aboutsummaryrefslogtreecommitdiff
path: root/util/qemu-thread-posix.c
diff options
context:
space:
mode:
authorPeter Maydell <peter.maydell@linaro.org>2017-09-26 19:49:08 +0100
committerPeter Maydell <peter.maydell@linaro.org>2017-09-26 19:49:08 +0100
commit31bc1d8481af414cfa2857f905e40f7d8e6d5b2e (patch)
tree4f7198397d7f32c8880490f69b91e5d50731e678 /util/qemu-thread-posix.c
parent2509dda283d438970028864dd89871bfe0263c3a (diff)
parent35deebb2327227d8c5f4816476befb06f6329de6 (diff)
Merge remote-tracking branch 'remotes/mjt/tags/trivial-patches-fetch' into staging
trivial patches for 2017-09-26 # gpg: Signature made Tue 26 Sep 2017 07:13:16 BST # gpg: using RSA key 0x701B4F6B1A693E59 # gpg: Good signature from "Michael Tokarev <mjt@tls.msk.ru>" # gpg: aka "Michael Tokarev <mjt@corpit.ru>" # gpg: aka "Michael Tokarev <mjt@debian.org>" # Primary key fingerprint: 6EE1 95D1 886E 8FFB 810D 4324 457C E0A0 8044 65C5 # Subkey fingerprint: 7B73 BAD6 8BE7 A2C2 8931 4B22 701B 4F6B 1A69 3E59 * remotes/mjt/tags/trivial-patches-fetch: (29 commits) hw/isa/pc87312: Mark the device with user_creatable = false Drop gld linker usage on SunOS tests/boot-sector: Increase timeout to 600 seconds nbd-client: Use correct macro parenthesization hw/display/virtio-gpu: Put the virtio-gpu-device into the display category osdep: Fix ROUND_UP(64-bit, 32-bit) target/xtensa: Use the pre-defined MEMTXATTRS_UNSPECIFIED macro trivial: Add missing "-m" parameter in docs/memory-hotplug.txt chardev/baum: fix baum that releases brlapi twice remove trailing whitespace from qemu-options.hx hw/display/xenfb.c: Add trace_xenfb_key_event aux-to-i2c-bridge: don't allow user to create one util/qemu-thread-posix.c: Replace OS ifdefs with CONFIG_HAVE_SEM_TIMEDWAIT MAINTAINERS: update docs/interop/ entries MAINTAINERS: update docs/devel/ entries MAINTAINERS: add missing Cryptography entry MAINTAINERS: add missing entry for Generic Loader MAINTAINERS: add missing AIO entry MAINTAINERS: add missing entries for throttling infra MAINTAINERS: add missing SSI entries ... Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Diffstat (limited to 'util/qemu-thread-posix.c')
-rw-r--r--util/qemu-thread-posix.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/util/qemu-thread-posix.c b/util/qemu-thread-posix.c
index 4e95d272dc..7306475899 100644
--- a/util/qemu-thread-posix.c
+++ b/util/qemu-thread-posix.c
@@ -168,7 +168,7 @@ void qemu_sem_init(QemuSemaphore *sem, int init)
{
int rc;
-#if defined(__APPLE__) || defined(__NetBSD__)
+#ifndef CONFIG_SEM_TIMEDWAIT
rc = pthread_mutex_init(&sem->lock, NULL);
if (rc != 0) {
error_exit(rc, __func__);
@@ -196,7 +196,7 @@ void qemu_sem_destroy(QemuSemaphore *sem)
assert(sem->initialized);
sem->initialized = false;
-#if defined(__APPLE__) || defined(__NetBSD__)
+#ifndef CONFIG_SEM_TIMEDWAIT
rc = pthread_cond_destroy(&sem->cond);
if (rc < 0) {
error_exit(rc, __func__);
@@ -218,7 +218,7 @@ void qemu_sem_post(QemuSemaphore *sem)
int rc;
assert(sem->initialized);
-#if defined(__APPLE__) || defined(__NetBSD__)
+#ifndef CONFIG_SEM_TIMEDWAIT
pthread_mutex_lock(&sem->lock);
if (sem->count == UINT_MAX) {
rc = EINVAL;
@@ -256,7 +256,7 @@ int qemu_sem_timedwait(QemuSemaphore *sem, int ms)
struct timespec ts;
assert(sem->initialized);
-#if defined(__APPLE__) || defined(__NetBSD__)
+#ifndef CONFIG_SEM_TIMEDWAIT
rc = 0;
compute_abs_deadline(&ts, ms);
pthread_mutex_lock(&sem->lock);
@@ -304,7 +304,7 @@ void qemu_sem_wait(QemuSemaphore *sem)
int rc;
assert(sem->initialized);
-#if defined(__APPLE__) || defined(__NetBSD__)
+#ifndef CONFIG_SEM_TIMEDWAIT
pthread_mutex_lock(&sem->lock);
while (sem->count == 0) {
rc = pthread_cond_wait(&sem->cond, &sem->lock);