about summary refs log tree commit diff
path: root/sysdeps/pthread
diff options
context:
space:
mode:
authorFlorian Weimer <fweimer@redhat.com>2021-05-11 11:08:00 +0200
committerFlorian Weimer <fweimer@redhat.com>2021-05-11 11:24:39 +0200
commitddd4a2d3c64642b34d95743db9032c2bb31c16b2 (patch)
treebfa7fb0ef9b4ba4cbf7412960ab665be2503db0c /sysdeps/pthread
parentdf65f897e9501aa5b64a5cbcb101301715f2ec2f (diff)
downloadglibc-ddd4a2d3c64642b34d95743db9032c2bb31c16b2.tar.gz
glibc-ddd4a2d3c64642b34d95743db9032c2bb31c16b2.tar.xz
glibc-ddd4a2d3c64642b34d95743db9032c2bb31c16b2.zip
nptl: Move thread join functions into libc
The symbols pthread_clockjoin_np, pthread_join, pthread_timedjoin_np,
pthread_tryjoin_np, thrd_join were moved using
scripts/move-symbol-to-libc.py.

Moving the symbols at the same time avoids the need for temporary
exports.

Reviewed-by: Adhemerval Zanella  <adhemerval.zanella@linaro.org>
Diffstat (limited to 'sysdeps/pthread')
-rw-r--r--sysdeps/pthread/Makefile3
-rw-r--r--sysdeps/pthread/thrd_join.c11
2 files changed, 12 insertions, 2 deletions
diff --git a/sysdeps/pthread/Makefile b/sysdeps/pthread/Makefile
index ec8e3af577..b15d085f51 100644
--- a/sysdeps/pthread/Makefile
+++ b/sysdeps/pthread/Makefile
@@ -31,7 +31,7 @@ headers += threads.h
 
 routines += thrd_current thrd_equal thrd_sleep thrd_yield
 
-libpthread-routines += thrd_create thrd_join
+libpthread-routines += thrd_create
 
 $(libpthread-routines-var) += \
   call_once \
@@ -49,6 +49,7 @@ $(libpthread-routines-var) += \
   mtx_unlock \
   thrd_detach \
   thrd_exit \
+  thrd_join \
   tss_create \
   tss_delete \
   tss_get \
diff --git a/sysdeps/pthread/thrd_join.c b/sysdeps/pthread/thrd_join.c
index 8b53092c12..8db96ce4a5 100644
--- a/sysdeps/pthread/thrd_join.c
+++ b/sysdeps/pthread/thrd_join.c
@@ -17,9 +17,10 @@
    <https://www.gnu.org/licenses/>.  */
 
 #include "thrd_priv.h"
+#include <shlib-compat.h>
 
 int
-thrd_join (thrd_t thr, int *res)
+__thrd_join (thrd_t thr, int *res)
 {
   void *pthread_res;
   int err_code = __pthread_join (thr, &pthread_res);
@@ -28,3 +29,11 @@ thrd_join (thrd_t thr, int *res)
 
   return thrd_err_map (err_code);
 }
+#if PTHREAD_IN_LIBC
+versioned_symbol (libc, __thrd_join, thrd_join, GLIBC_2_34);
+# if OTHER_SHLIB_COMPAT (libpthread, GLIBC_2_28, GLIBC_2_34)
+compat_symbol (libc, __thrd_join, thrd_join, GLIBC_2_28);
+# endif
+#else /* !PTHREAD_IN_LIBC */
+strong_alias (__thrd_join, thrd_join)
+#endif