From: Eric Blake <eblake@redhat.com>
To: Peter Maydell <peter.maydell@linaro.org>,
qemu-devel@nongnu.org, qemu-trivial@nongnu.org
Cc: patches@linaro.org
Subject: Re: [Qemu-devel] [PATCH] util/qemu-thread-posix.c: Replace OS ifdefs with CONFIG_HAVE_SEM_TIMEDWAIT
Date: Tue, 5 Sep 2017 09:11:53 -0500 [thread overview]
Message-ID: <f1f3dc26-8499-02ba-9dfc-a2e96e766b79@redhat.com> (raw)
In-Reply-To: <1504613972-15847-1-git-send-email-peter.maydell@linaro.org>
[-- Attachment #1: Type: text/plain, Size: 1398 bytes --]
On 09/05/2017 07:19 AM, Peter Maydell wrote:
> In qemu-thread-posix.c we have two implementations of the
> various qemu_sem_* functions, one of which uses native POSIX
> sem_* and the other of which emulates them with pthread conditions.
> This is necessary because not all our host OSes support
> sem_timedwait().
>
> Instead of a hard-coded list of OSes which don't implement
> sem_timedwait(), which gets out of date, make configure
> test for the presence of the function and set a new
> CONFIG_HAVE_SEM_TIMEDWAIT appropriately.
>
> In particular, newer NetBSDs have sem_timedwait(), so this
> commit will switch them over to using it. OSX still does
> not have an implementation.
>
> Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
> ---
> It would be nice to gradually reduce the number of places
> we do per-OS ifdeffery in favour of checking for the specific
> feature we care about in each case...
Yes, that's always been autoconf's philosophy: feature tests trump
platform tests every time, because platforms can add features over time,
and because an ifdef on a single feature test is easier to read than a
list of platform names.
> Tested on Linux, NetBSD, OSX.
>
Reviewed-by: Eric Blake <eblake@redhat.com>
--
Eric Blake, Principal Software Engineer
Red Hat, Inc. +1-919-301-3266
Virtualization: qemu.org | libvirt.org
[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 619 bytes --]
next prev parent reply other threads:[~2017-09-05 14:12 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-09-05 12:19 [Qemu-devel] [PATCH] util/qemu-thread-posix.c: Replace OS ifdefs with CONFIG_HAVE_SEM_TIMEDWAIT Peter Maydell
2017-09-05 12:57 ` [Qemu-devel] [Qemu-trivial] " Kamil Rytarowski
2017-09-05 14:11 ` Eric Blake [this message]
2017-09-14 7:53 ` [Qemu-devel] " Michael Tokarev
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=f1f3dc26-8499-02ba-9dfc-a2e96e766b79@redhat.com \
--to=eblake@redhat.com \
--cc=patches@linaro.org \
--cc=peter.maydell@linaro.org \
--cc=qemu-devel@nongnu.org \
--cc=qemu-trivial@nongnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).