diff options
| author | Florian Weimer <fweimer@redhat.com> | 2021-04-23 10:23:24 +0200 |
|---|---|---|
| committer | Florian Weimer <fweimer@redhat.com> | 2021-04-23 17:06:48 +0200 |
| commit | 4baf02b33235b7cdcb252bafebc132c66020eedd (patch) | |
| tree | 7ef1a1e8205d89a0224743f19c15443ce793aead | |
| parent | da8e3710d8791f4b7f164ba9eb45b823ada44634 (diff) | |
| download | glibc-4baf02b33235b7cdcb252bafebc132c66020eedd.tar.xz glibc-4baf02b33235b7cdcb252bafebc132c66020eedd.zip | |
nptl: Move pthread_spin_trylock into libc
The symbol was moved using scripts/move-symbol-to-libc.py.
72 files changed, 158 insertions, 52 deletions
diff --git a/nptl/Makefile b/nptl/Makefile index 011f53eab2..a736ad7e7a 100644 --- a/nptl/Makefile +++ b/nptl/Makefile @@ -132,6 +132,7 @@ routines = \ pthread_spin_destroy \ pthread_spin_init \ pthread_spin_lock \ + pthread_spin_trylock \ pthread_spin_unlock \ tpp \ unwind \ @@ -198,7 +199,6 @@ libpthread-routines = \ pthread_setname \ pthread_setschedprio \ pthread_sigqueue \ - pthread_spin_trylock \ pthread_testcancel \ pthread_timedjoin \ pthread_tryjoin \ diff --git a/nptl/Versions b/nptl/Versions index 242c3a3d9d..760c066382 100644 --- a/nptl/Versions +++ b/nptl/Versions @@ -82,6 +82,7 @@ libc { pthread_spin_destroy; pthread_spin_init; pthread_spin_lock; + pthread_spin_trylock; pthread_spin_unlock; } GLIBC_2.2.3 { @@ -186,6 +187,7 @@ libc { pthread_spin_destroy; pthread_spin_init; pthread_spin_lock; + pthread_spin_trylock; pthread_spin_unlock; } GLIBC_PRIVATE { @@ -318,7 +320,6 @@ libpthread { pthread_getcpuclockid; pthread_rwlock_timedrdlock; pthread_rwlock_timedwrlock; - pthread_spin_trylock; pthread_yield; sem_timedwait; } diff --git a/nptl/pthread_spin_trylock.c b/nptl/pthread_spin_trylock.c index 470734ad64..498c1882ba 100644 --- a/nptl/pthread_spin_trylock.c +++ b/nptl/pthread_spin_trylock.c @@ -19,9 +19,10 @@ #include <errno.h> #include <atomic.h> #include "pthreadP.h" +#include <shlib-compat.h> int -pthread_spin_trylock (pthread_spinlock_t *lock) +__pthread_spin_trylock (pthread_spinlock_t *lock) { /* For the spin try lock, we have the following possibilities: @@ -77,3 +78,10 @@ pthread_spin_trylock (pthread_spinlock_t *lock) return EBUSY; } +versioned_symbol (libc, __pthread_spin_trylock, pthread_spin_trylock, + GLIBC_2_34); + +#if OTHER_SHLIB_COMPAT (libpthread, GLIBC_2_2, GLIBC_2_34) +compat_symbol (libpthread, __pthread_spin_trylock, pthread_spin_trylock, + GLIBC_2_2); +#endif diff --git a/sysdeps/alpha/nptl/pthread_spin_trylock.S b/sysdeps/alpha/nptl/pthread_spin_trylock.S index ea4a55fef4..31ba50711c 100644 --- a/sysdeps/alpha/nptl/pthread_spin_trylock.S +++ b/sysdeps/alpha/nptl/pthread_spin_trylock.S @@ -16,6 +16,7 @@ License along with the GNU C Library. If not, see <https://www.gnu.org/licenses/>. */ +#include <shlib-compat.h> #define _ERRNO_H 1 #include <bits/errno.h> @@ -23,9 +24,9 @@ .text .align 4 - .globl pthread_spin_trylock - .ent pthread_spin_trylock -pthread_spin_trylock: + .globl __pthread_spin_trylock + .ent __pthread_spin_trylock +__pthread_spin_trylock: .frame $sp, 0, $26, 0 .prologue 0 @@ -42,4 +43,11 @@ pthread_spin_trylock: 1: ret 2: br 0b - .end pthread_spin_trylock + .end __pthread_spin_trylock +versioned_symbol (libc, __pthread_spin_trylock, pthread_spin_trylock, + GLIBC_2_34) + +#if OTHER_SHLIB_COMPAT (libpthread, GLIBC_2_2, GLIBC_2_34) +compat_symbol (libpthread, __pthread_spin_trylock, pthread_spin_trylock, + GLIBC_2_2) +#endif diff --git a/sysdeps/i386/pthread_spin_trylock.S b/sysdeps/i386/pthread_spin_trylock.S index e90d7288b9..9be0cb766e 100644 --- a/sysdeps/i386/pthread_spin_trylock.S +++ b/sysdeps/i386/pthread_spin_trylock.S @@ -18,9 +18,9 @@ #include <sysdep.h> #include <errno.h> +#include <shlib-compat.h> - -ENTRY (pthread_spin_trylock) +ENTRY (__pthread_spin_trylock) movl 4(%esp), %edx movl $1, %eax |
