about summary refs log tree commit diff
path: root/nptl
diff options
context:
space:
mode:
Diffstat (limited to 'nptl')
-rw-r--r--nptl/Makefile2
-rw-r--r--nptl/Versions4
-rw-r--r--nptl/pthreadP.h2
-rw-r--r--nptl/pthread_mutex_trylock.c18
4 files changed, 15 insertions, 11 deletions
diff --git a/nptl/Makefile b/nptl/Makefile
index 31d05b36e3..8e015157f5 100644
--- a/nptl/Makefile
+++ b/nptl/Makefile
@@ -101,6 +101,7 @@ routines = \
   pthread_mutex_lock \
   pthread_mutex_setprioceiling \
   pthread_mutex_timedlock \
+  pthread_mutex_trylock \
   pthread_mutex_unlock \
   pthread_once \
   pthread_rwlock_rdlock \
@@ -161,7 +162,6 @@ libpthread-routines = \
   pthread_getname \
   pthread_join \
   pthread_join_common \
-  pthread_mutex_trylock \
   pthread_mutexattr_destroy \
   pthread_mutexattr_getprioceiling \
   pthread_mutexattr_getprotocol \
diff --git a/nptl/Versions b/nptl/Versions
index ddf3bbb1cd..ab79ae2b21 100644
--- a/nptl/Versions
+++ b/nptl/Versions
@@ -5,6 +5,7 @@ libc {
     __pthread_mutex_destroy;
     __pthread_mutex_init;
     __pthread_mutex_lock;
+    __pthread_mutex_trylock;
     __pthread_mutex_unlock;
     __pthread_once;
     __pthread_setspecific;
@@ -44,6 +45,7 @@ libc {
     pthread_mutex_destroy;
     pthread_mutex_init;
     pthread_mutex_lock;
+    pthread_mutex_trylock;
     pthread_mutex_unlock;
     pthread_once;
     pthread_self;
@@ -195,7 +197,6 @@ libpthread {
     _IO_funlockfile;
     __errno_location;
     __h_errno_location;
-    __pthread_mutex_trylock;
     __pthread_mutexattr_destroy;
     __pthread_mutexattr_init;
     __pthread_mutexattr_settype;
@@ -207,7 +208,6 @@ libpthread {
     pthread_create;
     pthread_detach;
     pthread_join;
-    pthread_mutex_trylock;
     pthread_mutexattr_destroy;
     pthread_mutexattr_getkind_np;
     pthread_mutexattr_init;
diff --git a/nptl/pthreadP.h b/nptl/pthreadP.h
index 0def617109..8432c0ebe7 100644
--- a/nptl/pthreadP.h
+++ b/nptl/pthreadP.h
@@ -396,6 +396,7 @@ libc_hidden_proto (__pthread_mutex_init)
 extern int __pthread_mutex_destroy (pthread_mutex_t *__mutex);
 libc_hidden_proto (__pthread_mutex_destroy)
 extern int __pthread_mutex_trylock (pthread_mutex_t *_mutex);
+libc_hidden_proto (__pthread_mutex_trylock)
 extern int __pthread_mutex_lock (pthread_mutex_t *__mutex);
 libc_hidden_proto (__pthread_mutex_lock)
 extern int __pthread_mutex_timedlock (pthread_mutex_t *__mutex,
@@ -576,7 +577,6 @@ libc_hidden_proto (__pthread_sigmask);
 
 
 #if IS_IN (libpthread)
-hidden_proto (__pthread_mutex_trylock)
 hidden_proto (__pthread_rwlock_unlock)
 hidden_proto (__pthread_testcancel)
 hidden_proto (__pthread_mutexattr_init)
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