This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
Re: [PATCH 4/4] nptl: Add default cancellable futex calls
- From: "Joseph S. Myers" <joseph at codesourcery dot com>
- To: Adhemerval Zanella <azanella at linux dot vnet dot ibm dot com>
- Cc: "GNU C. Library" <libc-alpha at sourceware dot org>
- Date: Fri, 19 Sep 2014 17:02:52 +0000
- Subject: Re: [PATCH 4/4] nptl: Add default cancellable futex calls
- Authentication-results: sourceware.org; auth=none
- References: <541C2901 dot 1050609 at linux dot vnet dot ibm dot com> <541C2B18 dot 4090107 at linux dot vnet dot ibm dot com> <541C2DE0 dot 80100 at linux dot vnet dot ibm dot com>
On Fri, 19 Sep 2014, Adhemerval Zanella wrote:
> diff --git a/sysdeps/unix/sysv/linux/lowlevellock-futex.h b/sysdeps/unix/sysv/linux/lowlevellock-futex.h
> index 343afd6..2967ebb 100644
> --- a/sysdeps/unix/sysv/linux/lowlevellock-futex.h
> +++ b/sysdeps/unix/sysv/linux/lowlevellock-futex.h
> @@ -97,6 +97,49 @@
> val, timeout, NULL /* Unused. */, \
> FUTEX_BITSET_MATCH_ANY)
>
> +#define lll_futex_wait_cancel(futexp, val, private) \
> + lll_futex_timed_wait_cancel (futexp, val, NULL, private)
> +
> +#define lll_futex_timed_wait_cancel(futexp, val, timespec, private) \
> + ({ \
> + long int __ret; \
> + int __op = FUTEX_WAIT; \
> + \
> + __ret = __syscall_cancel (__NR_futex, (long int) (futexp), \
> + (long int)__lll_private_flag (__op, private), \
> + (long int)(val), (long int)(timespec), 0, 0); \
As with other patches, do not hardcode the use of "long" for syscall
arguments.
--
Joseph S. Myers
joseph@codesourcery.com