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.mayd...@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 <ebl...@redhat.com> -- Eric Blake, Principal Software Engineer Red Hat, Inc. +1-919-301-3266 Virtualization: qemu.org | libvirt.org
signature.asc
Description: OpenPGP digital signature