On Tue, Nov 29, 2016 at 12:47:01PM +0100, Paolo Bonzini wrote: > diff --git a/include/qemu/futex.h b/include/qemu/futex.h > new file mode 100644 > index 0000000..c3d1089 > --- /dev/null > +++ b/include/qemu/futex.h > @@ -0,0 +1,36 @@ > +/* > + * Wrappers around Linux futex syscall > + * > + * Copyright Red Hat, Inc. 2015 > + * > + * Author: > + * Paolo Bonzini <pbonz...@redhat.com> > + * > + * This work is licensed under the terms of the GNU GPL, version 2 or later. > + * See the COPYING file in the top-level directory. > + * > + */ > + > +#include <sys/syscall.h> > +#include <linux/futex.h> > + > +#define futex(...) syscall(__NR_futex, __VA_ARGS__) > + > +static inline void futex_wake(void *f, int n) > +{ > + futex(f, FUTEX_WAKE, n, NULL, NULL, 0); > +} > + > +static inline void futex_wait(void *f, unsigned val)
Now that this is being promoted to an include/ API please use qemu_futex(), qemu_futex_wake(), and qemu_futex_wait() names. It's a bit bold to use futex(), futex_wake(), and futex_wait(). We're relying on the fact that no system headers will ever use those names. I haven't reviewed this patch in detail but: Acked-by: Stefan Hajnoczi <stefa...@redhat.com>
signature.asc
Description: PGP signature