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] New condvar implementation that provides stronger ordering guarantees.


On Fri, 2016-05-27 at 12:46 +0100, Szabolcs Nagy wrote:
> On 26/05/16 14:21, Torvald Riegel wrote:
> > diff --git a/sysdeps/aarch64/nptl/bits/pthreadtypes.h b/sysdeps/aarch64/nptl/bits/pthreadtypes.h
> > index 13984a7..87c4804 100644
> > --- a/sysdeps/aarch64/nptl/bits/pthreadtypes.h
> > +++ b/sysdeps/aarch64/nptl/bits/pthreadtypes.h
> > @@ -90,17 +90,32 @@ typedef union
> >  {
> >    struct
> >    {
> > -    int __lock;
> > -    unsigned int __futex;
> > -    __extension__ unsigned long long int __total_seq;
> > -    __extension__ unsigned long long int __wakeup_seq;
> > -    __extension__ unsigned long long int __woken_seq;
> > -    void *__mutex;
> > -    unsigned int __nwaiters;
> > -    unsigned int __broadcast_seq;
> > +    __extension__ union
> > +    {
> > +      __extension__ unsigned long long int __wseq;
> > +      struct {
> > +	unsigned int __low;
> > +	unsigned int __high;
> > +      } __wseq32;
> > +    };
> > +    __extension__ union
> > +    {
> > +      __extension__ unsigned long long int __g1_start;
> > +      struct {
> > +	unsigned int __low;
> > +	unsigned int __high;
> > +      } __g1_start32;
> > +    };
> 
> are these __low/__high members needed (i dont see them used)?
> they may be misleading on bigendian targets.

They are used on archs that provide only 32b atomics (in which case the
aliased 64b value is not used, so no endianness problems).  I've kept
them in the declarations on archs with 64b atomics because ...

> the type definition seems to be similar across targets,
> maybe it could be shared in some generic header?

... I want to make this sharing easy.  I haven't done it right now, but
we can look at it as a follow-up.  This would apply to other definitions
in pthreadtypes.h too, so it seems a non-condvar-specific cleanup would
be best.


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