diff options
| author | Florian Weimer <fweimer@redhat.com> | 2021-05-03 09:10:57 +0200 |
|---|---|---|
| committer | Florian Weimer <fweimer@redhat.com> | 2021-05-03 09:18:16 +0200 |
| commit | c96dddd7311e7ffa2a7995de5c2560d9979fd962 (patch) | |
| tree | 0aebeb973544f89fd5cbb23e874cb8076b7b6f03 | |
| parent | e7d2d48e560a2091e2a03c527c333cd7b5618b25 (diff) | |
| download | glibc-c96dddd7311e7ffa2a7995de5c2560d9979fd962.tar.xz glibc-c96dddd7311e7ffa2a7995de5c2560d9979fd962.zip | |
nptl: Move pthread_rwlock_tryrdlock into libc
And __pthread_rwlock_tryrdlock as a compatibility symbol.
Remove the unused __libc_rwlock_tryrdlock macro.
The symbols were moved using scripts/move-symbol-to-libc.py.
Reviewed-by: Carlos O'Donell <carlos@redhat.com>
Tested-by: Carlos O'Donell <carlos@redhat.com>
65 files changed, 113 insertions, 68 deletions
diff --git a/nptl/Makefile b/nptl/Makefile index cbc5309365..fd0c9fae53 100644 --- a/nptl/Makefile +++ b/nptl/Makefile @@ -127,6 +127,7 @@ routines = \ pthread_rwlock_rdlock \ pthread_rwlock_timedrdlock \ pthread_rwlock_timedwrlock \ + pthread_rwlock_tryrdlock \ pthread_rwlock_unlock \ pthread_rwlock_wrlock \ pthread_self \ @@ -184,7 +185,6 @@ libpthread-routines = \ pthread_getname \ pthread_join \ pthread_join_common \ - pthread_rwlock_tryrdlock \ pthread_rwlock_trywrlock \ pthread_rwlockattr_destroy \ pthread_rwlockattr_getkind_np \ diff --git a/nptl/Versions b/nptl/Versions index 98008fd829..97700cfbd3 100644 --- a/nptl/Versions +++ b/nptl/Versions @@ -69,6 +69,7 @@ libc { pthread_rwlock_destroy; pthread_rwlock_init; pthread_rwlock_rdlock; + pthread_rwlock_tryrdlock; pthread_rwlock_unlock; pthread_rwlock_wrlock; } @@ -76,6 +77,7 @@ libc { __pthread_rwlock_destroy; __pthread_rwlock_init; __pthread_rwlock_rdlock; + __pthread_rwlock_tryrdlock; __pthread_rwlock_unlock; __pthread_rwlock_wrlock; pthread_condattr_getpshared; @@ -218,6 +220,7 @@ libc { pthread_rwlock_rdlock; pthread_rwlock_timedrdlock; pthread_rwlock_timedwrlock; + pthread_rwlock_tryrdlock; pthread_rwlock_unlock; pthread_rwlock_wrlock; pthread_setspecific; @@ -306,7 +309,6 @@ libpthread { pthread_attr_setstacksize; pthread_create; pthread_getconcurrency; - pthread_rwlock_tryrdlock; pthread_rwlock_trywrlock; pthread_rwlockattr_destroy; pthread_rwlockattr_getkind_np; @@ -334,7 +336,6 @@ libpthread { } GLIBC_2.2 { - __pthread_rwlock_tryrdlock; __pthread_rwlock_trywrlock; pthread_attr_getstack; pthread_attr_setstack; diff --git a/nptl/pthread_rwlock_tryrdlock.c b/nptl/pthread_rwlock_tryrdlock.c index f01012f86a..495541fc78 100644 --- a/nptl/pthread_rwlock_tryrdlock.c +++ b/nptl/pthread_rwlock_tryrdlock.c @@ -25,7 +25,7 @@ /* See pthread_rwlock_common.c for an overview. */ int -__pthread_rwlock_tryrdlock (pthread_rwlock_t *rwlock) +___pthread_rwlock_tryrdlock (pthread_rwlock_t *rwlock) { /* For tryrdlock, we could speculate that we will succeed and go ahead and register as a reader. However, if we misspeculate, we have to do the @@ -116,4 +116,15 @@ __pthread_rwlock_tryrdlock (pthread_rwlock_t *rwlock) } -strong_alias (__pthread_rwlock_tryrdlock, pthread_rwlock_tryrdlock) +versioned_symbol (libc, ___pthread_rwlock_tryrdlock, + pthread_rwlock_tryrdlock, GLIBC_2_34); +libc_hidden_ver (___pthread_rwlock_tryrdlock, __pthread_rwlock_tryrdlock) + +#if OTHER_SHLIB_COMPAT (libpthread, GLIBC_2_1, GLIBC_2_34) +compat_symbol (libpthread, ___pthread_rwlock_tryrdlock, + pthread_rwlock_tryrdlock, GLIBC_2_1); +#endif +#if OTHER_SHLIB_COMPAT (libpthread, GLIBC_2_2, GLIBC_2_34) +compat_symbol (libpthread, ___pthread_rwlock_tryrdlock, + __pthread_rwlock_tryrdlock, GLIBC_2_2); +#endif diff --git a/sysdeps/nptl/libc-lockP.h b/sysdeps/nptl/libc-lockP.h index 16a303e084..5bb1d5c5be 100644 --- a/sysdeps/nptl/libc-lockP.h +++ b/sysdeps/nptl/libc-lockP.h @@ -150,8 +150,6 @@ _Static_assert (LLL_LOCK_INITIALIZER == 0, "LLL_LOCK_INITIALIZER != 0"); # define __libc_lock_trylock(NAME) \ __libc_maybe_call (__pthread_mutex_trylock, (&(NAME)), 0) #endif -#define __libc_rwlock_tryrdlock(NAME) \ - __libc_maybe_call (__pthread_rwlock_tryrdlock, (&(NAME)), 0) #define __libc_rwlock_trywrlock(NAME) \ __libc_maybe_call (__pthread_rwlock_trywrlock, (&(NAME)), 0) @@ -268,7 +266,6 @@ extern int __pthread_rwlock_destroy (pthread_rwlock_t *__rwlock); extern int __pthread_rwlock_rdlock (pthread_rwlock_t *__rwlock); libc_hidden_proto (__pthread_rwlock_rdlock) -extern int __pthread_rwlock_tryrdlock (pthread_rwlock_t *__rwlock); extern int __pthread_rwlock_wrlock (pthread_rwlock_t *__rwlock); libc_hidden_proto (__pthread_rwlock_wrlock) @@ -293,14 +290,12 @@ libc_hidden_proto (__pthread_setcancelstate) # ifdef weak_extern weak_extern (__pthread_mutex_trylock) weak_extern (__pthread_mutexattr_destroy) -weak_extern (__pthread_rwlock_tryrdlock) weak_extern (__pthread_rwlock_trywrlock) weak_extern (__pthread_initialize) weak_extern (__pthread_atfork) # else # pragma weak __pthread_mutex_trylock # pragma weak __pthread_mutexattr_destroy -# pragma weak __pthread_rwlock_tryrdlock # pragma weak __pthread_rwlock_trywrlock # pragma weak __pthread_initialize # pragma weak __pthread_atfork diff --git a/sysdeps/unix/sysv/linux/aarch64/libc.abilist b/sysdeps/unix/sysv/linux/aarch64/libc.abilist index 7d707fb143..e280bac89f 100644 --- a/sysdeps/unix/sysv/linux/aarch64/libc.abilist +++ b/sysdeps/unix/sysv/linux/aarch64/libc.abilist @@ -353,6 +353,7 @@ GLIBC_2.17 __pthread_once F GLIBC_2.17 __pthread_rwlock_destroy F GLIBC_2.17 __pthread_rwlock_init F GLIBC_2.17 __pthread_rwlock_rdlock F +GLIBC_2.17 __pthread_rwlock_tryrdlock F GLIBC_2.17 __pthread_rwlock_unlock F GLIBC_2.17 __pthread_rwlock_wrlock F GLIBC_2.17 __pthread_setspecific F @@ -1507,6 +1508,7 @@ GLIBC_2.17 pthread_rwlock_init F GLIBC_2.17 pthread_rwlock_rdlock F GLIBC_2.17 pthread_rwlock_timedrdlock F GLIBC_2.17 pthread_rwlock_timedwrlock F +GLIBC_2.17 pthread_rwlock_tryrdlock F GLIBC_2.17 pthread_rwlock_unlock F GLIBC_2.17 pthread_rwlock_wrlock F GLIBC_2.17 pthread_self F @@ -2316,6 +2318,7 @@ GLIBC_2.34 pthread_rwlock_init F GLIBC_2.34 pthread_rwlock_rdlock F GLIBC_2.34 pthread_rwlock_timedrdlock F GLIBC_2.34 pthread_rwlock_timedwrlock F +GLIBC_2.34 pthread_rwlock_tryrdlock F GLIBC_2.34 pthread_rwlock_unlock F GLIBC_2.34 pthread_rwlock_wrlock F GL |
