From 4baf02b33235b7cdcb252bafebc132c66020eedd Mon Sep 17 00:00:00 2001 From: Florian Weimer Date: Fri, 23 Apr 2021 10:23:24 +0200 Subject: nptl: Move pthread_spin_trylock into libc The symbol was moved using scripts/move-symbol-to-libc.py. --- nptl/Makefile | 2 +- nptl/Versions | 3 ++- nptl/pthread_spin_trylock.c | 10 +++++++++- 3 files changed, 12 insertions(+), 3 deletions(-) (limited to 'nptl') 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 #include #include "pthreadP.h" +#include 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 -- cgit 1.4.1