diff options
author | Adhemerval Zanella <adhemerval.zanella@linaro.org> | 2019-02-22 12:10:26 -0300 |
---|---|---|
committer | Adhemerval Zanella <adhemerval.zanella@linaro.org> | 2019-05-14 08:44:03 -0300 |
commit | 959aff9fa22c45e0fa11cd88c9f8ea10bd9ba494 (patch) | |
tree | e5b227f07c74b644e8b2d71a9186b1f9ea79baab /sysdeps | |
parent | d7e4c642ef13933361c276df87c52e83b2c212a2 (diff) | |
download | glibc-959aff9fa22c45e0fa11cd88c9f8ea10bd9ba494.tar glibc-959aff9fa22c45e0fa11cd88c9f8ea10bd9ba494.tar.gz glibc-959aff9fa22c45e0fa11cd88c9f8ea10bd9ba494.tar.bz2 glibc-959aff9fa22c45e0fa11cd88c9f8ea10bd9ba494.zip |
Assume LLL_LOCK_INITIALIZER is 0
Since hppa is not an outlier anymore regarding LLL_LOCK_INITIALIZER value,
we can now assume it 0 for all architectures.
Checked on a build for all major ABIs.
* nptl/nptl-init.c (__pthread_initialize_minimal_internal): Remove
initialization for LLL_LOCK_INITIALIZER different than 0.
* nptl/old_pthread_cond_broadcast.c (__pthread_cond_broadcast_2_0):
Assume LLL_LOCK_INITIALIZER being 0.
* nptl/old_pthread_cond_signal.c (__pthread_cond_signal_2_0): Likewise.
* nptl/old_pthread_cond_timedwait.c (__pthread_cond_timedwait_2_0):
Likewise.
* nptl/old_pthread_cond_wait.c (__pthread_cond_wait_2_0): Likewise.
* sysdeps/nptl/libc-lockP.h (__libc_lock_define_initialized): Likewise.
Diffstat (limited to 'sysdeps')
-rw-r--r-- | sysdeps/nptl/libc-lockP.h | 17 |
1 files changed, 3 insertions, 14 deletions
diff --git a/sysdeps/nptl/libc-lockP.h b/sysdeps/nptl/libc-lockP.h index fc1bfe57e5..07d583f11a 100644 --- a/sysdeps/nptl/libc-lockP.h +++ b/sysdeps/nptl/libc-lockP.h @@ -71,23 +71,12 @@ typedef pthread_key_t __libc_key_t; For the C library we take a deeper look at the initializer. For this implementation all fields are initialized to zero. Therefore we don't initialize the variable which allows putting it into the - BSS section. (Except on PA-RISC and other odd architectures, where - initialized locks must be set to one due to the lack of normal - atomic operations.) */ + BSS section. */ +_Static_assert (LLL_LOCK_INITIALIZER == 0, "LLL_LOCK_INITIALIZER != 0"); #define _LIBC_LOCK_INITIALIZER LLL_LOCK_INITIALIZER -#if IS_IN (libc) || IS_IN (libpthread) -# if LLL_LOCK_INITIALIZER == 0 -# define __libc_lock_define_initialized(CLASS,NAME) \ - CLASS __libc_lock_t NAME; -# else -# define __libc_lock_define_initialized(CLASS,NAME) \ - CLASS __libc_lock_t NAME = LLL_LOCK_INITIALIZER; -# endif -#else -# define __libc_lock_define_initialized(CLASS,NAME) \ +#define __libc_lock_define_initialized(CLASS,NAME) \ CLASS __libc_lock_t NAME; -#endif #define __libc_rwlock_define_initialized(CLASS,NAME) \ CLASS __libc_rwlock_t NAME = PTHREAD_RWLOCK_INITIALIZER; |