This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
Re: [PATCH] Define __PTHREAD_MUTEX_HAVE_PREV only if undefined [BZ #22298]
On Okt 16 2017, "H.J. Lu" <hjl.tools@gmail.com> wrote:
> On Mon, Oct 16, 2017 at 7:31 AM, Andreas Schwab <schwab@suse.de> wrote:
>> On Okt 16 2017, Adhemerval Zanella <adhemerval.zanella@linaro.org> wrote:
>>
>>> diff --git a/sysdeps/nptl/bits/thread-shared-types.h b/sysdeps/nptl/bits/thread-shared-types.h
>>> index 68b82b6..5dfe01e 100644
>>> --- a/sysdeps/nptl/bits/thread-shared-types.h
>>> +++ b/sysdeps/nptl/bits/thread-shared-types.h
>>> @@ -58,8 +58,7 @@
>>> #include <bits/pthreadtypes-arch.h>
>>>
>>> /* Common definition of pthread_mutex_t. */
>>> -
>>> -#if __WORDSIZE == 64
>>> +#if __PTHREAD_MUTEX_HAVE_PREV
>>> typedef struct __pthread_internal_list
>>> {
>>> struct __pthread_internal_list *__prev;
>>> @@ -74,7 +73,7 @@ typedef struct __pthread_internal_slist
>>>
>>> /* Lock elision support. */
>>> #if __PTHREAD_MUTEX_LOCK_ELISION
>>> -# if __WORDSIZE == 64
>>> +# if __PTHREAD_MUTEX_HAVE_PREV
>>> # define __PTHREAD_SPINS_DATA \
>>> short __spins; \
>>> short __elision
>>> @@ -101,17 +100,16 @@ struct __pthread_mutex_s
>>> int __lock __LOCK_ALIGNMENT;
>>> unsigned int __count;
>>> int __owner;
>>> -#if __WORDSIZE == 64
>>> +#if __PTHREAD_MUTEX_HAVE_PREV
>>> unsigned int __nusers;
>>> #endif
>>
>> The name doesn't really fit here. There is nothing matching prev in
>> __nusers or __PTHREAD_SPINS_DATA.
>>
>
> True. But they are tied together.
Are they? They look rather unrelated, or only related by chance.
Andreas.
--
Andreas Schwab, SUSE Labs, schwab@suse.de
GPG Key fingerprint = 0196 BAD8 1CE9 1970 F4BE 1748 E4D4 88E3 0EEA B9D7
"And now for something completely different."