This is the mail archive of the libc-alpha@sourceware.org mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH 4/4] nptl: Add default cancellable futex calls


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]