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] Define __PTHREAD_MUTEX_HAVE_PREV only if undefined [BZ #22298]



On 18/10/2017 10:35, H.J. Lu wrote:
> On Wed, Oct 18, 2017 at 4:06 AM, Adhemerval Zanella
> <adhemerval.zanella@linaro.org> wrote:
>>
>>
>> On 18/10/2017 06:21, Andreas Schwab wrote:
>>> On Okt 17 2017, "H.J. Lu" <hjl.tools@gmail.com> wrote:
>>>
>>>> 2.  Define __PTHREAD_SPINS_DATA_IN_STRUCT to control
>>>> __PTHREAD_SPINS_DATA
>>>> 3. __PTHREAD_MUTEX_NUSERS_BEFORE_KIND to control where to
>>>> put __nusers.
>>>
>>> Yes, this looks like the right approach.  Though I would define the
>>> macros in a way so that defining them to 0 results in the preferred
>>> layout for future architectures (thus __PTHREAD_MUTEX_NUSERS_AFTER_KIND
>>> instead of __PTHREAD_MUTEX_NUSERS_BEFORE_KIND).
>>> __PTHREAD_SPINS_DATA_IN_STRUCT could then imply
>>> __PTHREAD_MUTEX_HAVE_PREV as before, since both are only needed due to
>>> space constraints for linuxthreads compatibility (perhaps rename it to
>>> __PTHREAD_MUTEX_USE_UNION?).
>>>
>>> Andreas.
>>>
>>
>> Alright, I will adapt my first submission to follow this.
> 
> Please use a separate patch to check offsets which should be backported
> to 2.25 branch.
> 

Yes, My idea is to follow your suggestion:

  1. One patch to check offsets of all relevant fields in struct
     __pthread_mutex_s.
  2. Another patch to define __PTHREAD_SPINS_DATA_IN_STRUCT to control
     __PTHREAD_SPINS_DATA
  3. Another to define __PTHREAD_MUTEX_NUSERS_BEFORE_KIND to control where to
     put __nusers (not sure if it worth to bind 2. and 3. together).


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