about summary refs log tree commit diff
path: root/nptl/pthread_mutex_trylock.c
diff options
context:
space:
mode:
authorFlorian Weimer <fweimer@redhat.com>2021-04-23 09:44:23 +0200
committerFlorian Weimer <fweimer@redhat.com>2021-04-23 09:44:23 +0200
commita2b0f2e1864f03084138a105e1d5f2cf86a62425 (patch)
tree1bfe09513168993ce36a56ddd605053b653f1c35 /nptl/pthread_mutex_trylock.c
parent4372dc7eaaa81fc04554626b7f02c9759a04a65b (diff)
downloadglibc-a2b0f2e1864f03084138a105e1d5f2cf86a62425.tar.gz
glibc-a2b0f2e1864f03084138a105e1d5f2cf86a62425.tar.xz
glibc-a2b0f2e1864f03084138a105e1d5f2cf86a62425.zip
nptl: Move pthread_mutex_trylock, __pthread_mutex_trylock into libc
The symbols were moved using scripts/move-symbol-to-libc.py.

__pthread_mutex_trylock is used to implement mtx_timedlock,
which still resides in libpthread, so add a GLIBC_2.34 version
for it, to match the existing GLIBC_2.0 version.
Diffstat (limited to 'nptl/pthread_mutex_trylock.c')
-rw-r--r--nptl/pthread_mutex_trylock.c18
1 files changed, 11 insertions, 7 deletions
diff --git a/nptl/pthread_mutex_trylock.c b/nptl/pthread_mutex_trylock.c
index e52dddafbd..623ea75db0 100644
--- a/nptl/pthread_mutex_trylock.c
+++ b/nptl/pthread_mutex_trylock.c
@@ -24,7 +24,7 @@
 #include <futex-internal.h>
 
 int
-__pthread_mutex_trylock (pthread_mutex_t *mutex)
+___pthread_mutex_trylock (pthread_mutex_t *mutex)
 {
   int oldval;
   pid_t id = THREAD_GETMEM (THREAD_SELF, tid);
@@ -449,10 +449,14 @@ __pthread_mutex_trylock (pthread_mutex_t *mutex)
 
   return EBUSY;
 }
-
-#ifndef __pthread_mutex_trylock
-#ifndef pthread_mutex_trylock
-weak_alias (__pthread_mutex_trylock, pthread_mutex_trylock)
-hidden_def (__pthread_mutex_trylock)
-#endif
+libc_hidden_ver (___pthread_mutex_trylock, __pthread_mutex_trylock)
+versioned_symbol (libc, ___pthread_mutex_trylock,
+		  pthread_mutex_trylock, GLIBC_2_34);
+versioned_symbol (libc, ___pthread_mutex_trylock,
+		  __pthread_mutex_trylock, GLIBC_2_34);
+#if OTHER_SHLIB_COMPAT (libpthread, GLIBC_2_0, GLIBC_2_34)
+compat_symbol (libpthread, ___pthread_mutex_trylock,
+	       pthread_mutex_trylock, GLIBC_2_0);
+compat_symbol (libpthread, ___pthread_mutex_trylock,
+	       __pthread_mutex_trylock, GLIBC_2_0);
 #endif