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]
- From: Andreas Schwab <schwab at suse dot de>
- To: Adhemerval Zanella <adhemerval dot zanella at linaro dot org>
- Cc: "H.J. Lu" <hjl dot tools at gmail dot com>, GNU C Library <libc-alpha at sourceware dot org>
- Date: Mon, 16 Oct 2017 16:31:56 +0200
- Subject: Re: [PATCH] Define __PTHREAD_MUTEX_HAVE_PREV only if undefined [BZ #22298]
- Authentication-results: sourceware.org; auth=none
- References: <20171015151100.GA29201@gmail.com> <8e04ab2f-bace-6ebc-85ab-740159c99985@linaro.org>
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.
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."