aboutsummaryrefslogtreecommitdiff
path: root/sysdeps/pthread/mtx_trylock.c
diff options
context:
space:
mode:
authorFlorian Weimer <fweimer@redhat.com>2021-05-03 08:12:11 +0200
committerFlorian Weimer <fweimer@redhat.com>2021-05-03 08:15:58 +0200
commit08970190fc225b319ba456f621a62a50858fa0f6 (patch)
treed926adc67470162c0b933270987f08c37b1ff7fd /sysdeps/pthread/mtx_trylock.c
parent032a9e17a7201765228262b9b6731839dcfdf885 (diff)
downloadglibc-08970190fc225b319ba456f621a62a50858fa0f6.zip
glibc-08970190fc225b319ba456f621a62a50858fa0f6.tar.gz
glibc-08970190fc225b319ba456f621a62a50858fa0f6.tar.bz2
nptl: Move mtx_trylock into libc
The symbol was moved using scripts/move-symbol-to-libc.py. The __pthread_mutex_trylock@@GLIBC_2.34 symbol version is no longer needed because the call is now internal to libc, so remove it with this commit. Reviewed-by: Carlos O'Donell <carlos@redhat.com> Tested-by: Carlos O'Donell <carlos@redhat.com>
Diffstat (limited to 'sysdeps/pthread/mtx_trylock.c')
-rw-r--r--sysdeps/pthread/mtx_trylock.c11
1 files changed, 10 insertions, 1 deletions
diff --git a/sysdeps/pthread/mtx_trylock.c b/sysdeps/pthread/mtx_trylock.c
index 0656e98..598701b 100644
--- a/sysdeps/pthread/mtx_trylock.c
+++ b/sysdeps/pthread/mtx_trylock.c
@@ -16,11 +16,20 @@
License along with the GNU C Library; if not, see
<https://www.gnu.org/licenses/>. */
+#include <shlib-compat.h>
#include "thrd_priv.h"
int
-mtx_trylock (mtx_t *mutex)
+__mtx_trylock (mtx_t *mutex)
{
int err_code = __pthread_mutex_trylock ((pthread_mutex_t *) mutex);
return thrd_err_map (err_code);
}
+#if PTHREAD_IN_LIBC
+versioned_symbol (libc, __mtx_trylock, mtx_trylock, GLIBC_2_34);
+# if OTHER_SHLIB_COMPAT (libpthread, GLIBC_2_28, GLIBC_2_34)
+compat_symbol (libpthread, __mtx_trylock, mtx_trylock, GLIBC_2_28);
+# endif
+#else /* !PTHREAD_IN_LIBC */
+strong_alias (__mtx_trylock, mtx_trylock)
+#endif