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 siddhesh/wait_bitset] Use FUTEX_WAIT_BITSET for pthread_cond_timedwaitfor non-x86: ppc, s390


On 2012-11-05 02:34, Siddhesh Poyarekar wrote:
> +#else
> +#define lll_futex_timed_wait_bitset(futexp, val, timespec, clockbit, private) \
> +  ({									      \
> +    INTERNAL_SYSCALL_DECL (__err);					      \
> +    long int __ret;							      \
> +    int __op = FUTEX_WAIT_BITSET | clockbit;				      \
> +									      \
> +    __ret = INTERNAL_SYSCALL (futex, __err, 6, (futexp),		      \
> +			      __lll_private_flag (__op, private),	      \
> +			      (val), (timespec), NULL /* Unused.  */, 	      \
> +			      FUTEX_BITSET_MATCH_ANY);			      \
> +    __ret;								      \
> +  })

The nice thing about using this version is that it is totally generic,
and usable on all targets.

While I wouldn't expect you to rearrange the current structure of all
of the lowlevellock.h headers to something that could actually share
this, having the generic version pasted into each makes it much more
obvious that each target is doing the same thing.


r~


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