aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorgfleury <gfleury@disroot.org>2025-08-15 20:14:58 +0200
committerSamuel Thibault <samuel.thibault@ens-lyon.org>2025-08-16 01:44:51 +0200
commitb6616efe8c5a94dc39f7d9da861fa15722ce834f (patch)
tree5a03de7739d5fc017f4e2248321094a1e316ee6e
parent36982b0fdbbce231afc8828f53a561196ba3b898 (diff)
downloadglibc-b6616efe8c5a94dc39f7d9da861fa15722ce834f.zip
glibc-b6616efe8c5a94dc39f7d9da861fa15722ce834f.tar.gz
glibc-b6616efe8c5a94dc39f7d9da861fa15722ce834f.tar.bz2
htl: move pthread_{join, clockjoin_np, timedjoin_np, tryjoin_np} into libc.
Message-ID: <20250815181500.107433-18-gfleury@disroot.org>
-rw-r--r--htl/Makefile2
-rw-r--r--htl/Versions12
-rw-r--r--htl/pt-join.c30
-rw-r--r--sysdeps/htl/pthreadP.h10
-rw-r--r--sysdeps/mach/hurd/i386/libc.abilist8
-rw-r--r--sysdeps/mach/hurd/i386/libpthread.abilist4
-rw-r--r--sysdeps/mach/hurd/x86_64/libc.abilist8
-rw-r--r--sysdeps/mach/hurd/x86_64/libpthread.abilist4
8 files changed, 61 insertions, 17 deletions
diff --git a/htl/Makefile b/htl/Makefile
index 8530098..ab78372 100644
--- a/htl/Makefile
+++ b/htl/Makefile
@@ -27,7 +27,6 @@ LCLHDRS :=
libpthread-routines := \
pt-create \
pt-initialize \
- pt-join \
pt-spin-inlines \
pt-hurd-cond-wait \
pt-hurd-cond-timedwait \
@@ -147,6 +146,7 @@ routines := \
pt-getschedparam \
pt-getspecific \
pt-init-specific \
+ pt-join \
pt-key-create \
pt-key-delete \
pt-kill \
diff --git a/htl/Versions b/htl/Versions
index 44af006..1c7e82c 100644
--- a/htl/Versions
+++ b/htl/Versions
@@ -55,6 +55,7 @@ libc {
pthread_detach;
pthread_getattr_np;
pthread_getconcurrency;
+ pthread_join;
pthread_key_create;
pthread_key_delete;
pthread_kill;
@@ -129,6 +130,7 @@ libc {
thrd_current; thrd_equal; thrd_sleep; thrd_yield;
pthread_cond_clockwait;
+ pthread_clockjoin_np;
pthread_mutex_clocklock;
@@ -138,6 +140,7 @@ libc {
pthread_mutexattr_setrobust; pthread_mutexattr_setrobust_np;
pthread_rwlock_clockrdlock; pthread_rwlock_clockwrlock;
+ pthread_timedjoin_np; pthread_tryjoin_np;
}
GLIBC_2.41 {
@@ -202,15 +205,19 @@ libc {
GLIBC_2.43 {
pthread_cancel;
+ pthread_clockjoin_np;
pthread_detach;
pthread_getattr_np;
pthread_getconcurrency;
pthread_getcpuclockid;
+ pthread_join;
pthread_kill;
pthread_mutex_transfer_np;
pthread_setconcurrency;
pthread_setschedprio;
pthread_testcancel;
+ pthread_timedjoin_np;
+ pthread_tryjoin_np;
pthread_yield;
}
@@ -248,6 +255,7 @@ libc {
__pthread_destroy_specific;
__pthread_exit;
__pthread_getspecific;
+ __pthread_join;
__pthread_key_delete;
__pthread_max_threads;
__pthread_mutex_checklocked;
@@ -301,8 +309,6 @@ libpthread {
pthread_create;
- pthread_join;
-
sem_close; sem_destroy; sem_getvalue; sem_init; sem_open; sem_post;
sem_timedwait; sem_trywait; sem_unlink; sem_wait;
@@ -325,8 +331,6 @@ libpthread {
cnd_broadcast; cnd_destroy; cnd_init; cnd_signal; cnd_timedwait; cnd_wait;
tss_create; tss_delete; tss_get; tss_set;
- pthread_tryjoin_np; pthread_timedjoin_np; pthread_clockjoin_np;
-
sem_clockwait;
}
diff --git a/htl/pt-join.c b/htl/pt-join.c
index 4e4798a..7a8da01 100644
--- a/htl/pt-join.c
+++ b/htl/pt-join.c
@@ -21,6 +21,8 @@
#include <stddef.h>
#include <pt-internal.h>
+#include <shlib-compat.h>
+#include <ldsodefs.h>
/* Make calling thread wait for termination of thread THREAD. Return
the exit status of the thread in *STATUS. */
@@ -96,14 +98,24 @@ __pthread_join (pthread_t thread, void **status)
{
return __pthread_join_common (thread, status, 0, CLOCK_REALTIME, NULL);
}
-weak_alias (__pthread_join, pthread_join);
+libc_hidden_def (__pthread_join)
+versioned_symbol (libc, __pthread_join, pthread_join, GLIBC_2_43);
+
+#if OTHER_SHLIB_COMPAT (libpthread, GLIBC_2_12, GLIBC_2_43)
+compat_symbol (libc, __pthread_join, pthread_join, GLIBC_2_12);
+#endif
int
__pthread_tryjoin_np (pthread_t thread, void **status)
{
return __pthread_join_common (thread, status, 1, CLOCK_REALTIME, NULL);
}
-weak_alias (__pthread_tryjoin_np, pthread_tryjoin_np);
+libc_hidden_def (__pthread_tryjoin_np)
+versioned_symbol (libc, __pthread_tryjoin_np, pthread_tryjoin_np, GLIBC_2_43);
+
+#if OTHER_SHLIB_COMPAT (libpthread, GLIBC_2_32, GLIBC_2_43)
+compat_symbol (libc, __pthread_tryjoin_np, pthread_tryjoin_np, GLIBC_2_32);
+#endif
int
__pthread_timedjoin_np (pthread_t thread, void **status,
@@ -111,7 +123,12 @@ __pthread_timedjoin_np (pthread_t thread, void **status,
{
return __pthread_join_common (thread, status, 0, CLOCK_REALTIME, abstime);
}
-weak_alias (__pthread_timedjoin_np, pthread_timedjoin_np);
+libc_hidden_def (__pthread_timedjoin_np)
+versioned_symbol (libc, __pthread_timedjoin_np, pthread_timedjoin_np, GLIBC_2_43);
+
+#if OTHER_SHLIB_COMPAT (libpthread, GLIBC_2_32, GLIBC_2_43)
+compat_symbol (libc, __pthread_timedjoin_np, pthread_timedjoin_np, GLIBC_2_32);
+#endif
int
__pthread_clockjoin_np (pthread_t thread, void **status,
@@ -120,4 +137,9 @@ __pthread_clockjoin_np (pthread_t thread, void **status,
{
return __pthread_join_common (thread, status, 0, clockid, abstime);
}
-weak_alias (__pthread_clockjoin_np, pthread_clockjoin_np);
+libc_hidden_def (__pthread_clockjoin_np)
+versioned_symbol (libc, __pthread_clockjoin_np, pthread_clockjoin_np, GLIBC_2_43);
+
+#if OTHER_SHLIB_COMPAT (libpthread, GLIBC_2_32, GLIBC_2_43)
+compat_symbol (libc, __pthread_clockjoin_np, pthread_clockjoin_np, GLIBC_2_32);
+#endif
diff --git a/sysdeps/htl/pthreadP.h b/sysdeps/htl/pthreadP.h
index e0f0f7d..9273a58 100644
--- a/sysdeps/htl/pthreadP.h
+++ b/sysdeps/htl/pthreadP.h
@@ -184,6 +184,16 @@ libc_hidden_proto (__pthread_detach)
void __pthread_exit (void *value) __attribute__ ((__noreturn__));
libc_hidden_proto (__pthread_exit)
int __pthread_join (pthread_t, void **);
+libc_hidden_proto (__pthread_join)
+int __pthread_tryjoin_np (pthread_t __th, void **__thread_return);
+libc_hidden_proto (__pthread_tryjoin_np)
+int __pthread_timedjoin_np (pthread_t __th, void **__thread_return,
+ const struct timespec *__abstime);
+libc_hidden_proto (__pthread_timedjoin_np)
+int __pthread_clockjoin_np (pthread_t __th, void **__thread_return,
+ clockid_t __clockid,
+ const struct timespec *__abstime);
+libc_hidden_proto (__pthread_clockjoin_np)
int __cthread_keycreate (__cthread_key_t *);
int __cthread_getspecific (__cthread_key_t, void **);
int __cthread_setspecific (__cthread_key_t, void *);
diff --git a/sysdeps/mach/hurd/i386/libc.abilist b/sysdeps/mach/hurd/i386/libc.abilist
index 2ec557b..1e54548 100644
--- a/sysdeps/mach/hurd/i386/libc.abilist
+++ b/sysdeps/mach/hurd/i386/libc.abilist
@@ -81,6 +81,7 @@ GLIBC_2.12 pthread_getconcurrency F
GLIBC_2.12 pthread_getcpuclockid F
GLIBC_2.12 pthread_getschedparam F
GLIBC_2.12 pthread_getspecific F
+GLIBC_2.12 pthread_join F
GLIBC_2.12 pthread_key_create F
GLIBC_2.12 pthread_key_delete F
GLIBC_2.12 pthread_kill F
@@ -2313,6 +2314,7 @@ GLIBC_2.30 twalk_r F
GLIBC_2.32 __libc_single_threaded D 0x1
GLIBC_2.32 mach_print F
GLIBC_2.32 mremap F
+GLIBC_2.32 pthread_clockjoin_np F
GLIBC_2.32 pthread_cond_clockwait F
GLIBC_2.32 pthread_mutex_clocklock F
GLIBC_2.32 pthread_mutex_consistent F
@@ -2323,6 +2325,8 @@ GLIBC_2.32 pthread_mutexattr_setrobust F
GLIBC_2.32 pthread_mutexattr_setrobust_np F
GLIBC_2.32 pthread_rwlock_clockrdlock F
GLIBC_2.32 pthread_rwlock_clockwrlock F
+GLIBC_2.32 pthread_timedjoin_np F
+GLIBC_2.32 pthread_tryjoin_np F
GLIBC_2.32 sigabbrev_np F
GLIBC_2.32 sigdescr_np F
GLIBC_2.32 strerrordesc_np F
@@ -2648,15 +2652,19 @@ GLIBC_2.42 uimaxabs F
GLIBC_2.42 ulabs F
GLIBC_2.42 ullabs F
GLIBC_2.43 pthread_cancel F
+GLIBC_2.43 pthread_clockjoin_np F
GLIBC_2.43 pthread_detach F
GLIBC_2.43 pthread_getattr_np F
GLIBC_2.43 pthread_getconcurrency F
GLIBC_2.43 pthread_getcpuclockid F
+GLIBC_2.43 pthread_join F
GLIBC_2.43 pthread_kill F
GLIBC_2.43 pthread_mutex_transfer_np F
GLIBC_2.43 pthread_setconcurrency F
GLIBC_2.43 pthread_setschedprio F
GLIBC_2.43 pthread_testcancel F
+GLIBC_2.43 pthread_timedjoin_np F
+GLIBC_2.43 pthread_tryjoin_np F
GLIBC_2.43 pthread_yield F
GLIBC_2.5 __readlinkat_chk F
GLIBC_2.5 inet6_opt_append F
diff --git a/sysdeps/mach/hurd/i386/libpthread.abilist b/sysdeps/mach/hurd/i386/libpthread.abilist
index 3f3c17c..8a056c8 100644
--- a/sysdeps/mach/hurd/i386/libpthread.abilist
+++ b/sysdeps/mach/hurd/i386/libpthread.abilist
@@ -19,7 +19,6 @@ GLIBC_2.12 ftrylockfile F
GLIBC_2.12 funlockfile F
GLIBC_2.12 pthread_atfork F
GLIBC_2.12 pthread_create F
-GLIBC_2.12 pthread_join F
GLIBC_2.12 pthread_spin_destroy F
GLIBC_2.12 pthread_spin_init F
GLIBC_2.12 pthread_spin_lock F
@@ -55,9 +54,6 @@ GLIBC_2.32 mtx_lock F
GLIBC_2.32 mtx_timedlock F
GLIBC_2.32 mtx_trylock F
GLIBC_2.32 mtx_unlock F
-GLIBC_2.32 pthread_clockjoin_np F
-GLIBC_2.32 pthread_timedjoin_np F
-GLIBC_2.32 pthread_tryjoin_np F
GLIBC_2.32 sem_clockwait F
GLIBC_2.32 thrd_create F
GLIBC_2.32 thrd_detach F
diff --git a/sysdeps/mach/hurd/x86_64/libc.abilist b/sysdeps/mach/hurd/x86_64/libc.abilist
index 2e7e007..1bf1bca 100644
--- a/sysdeps/mach/hurd/x86_64/libc.abilist
+++ b/sysdeps/mach/hurd/x86_64/libc.abilist
@@ -1542,6 +1542,7 @@ GLIBC_2.38 pthread_barrierattr_getpshared F
GLIBC_2.38 pthread_barrierattr_init F
GLIBC_2.38 pthread_barrierattr_setpshared F
GLIBC_2.38 pthread_cancel F
+GLIBC_2.38 pthread_clockjoin_np F
GLIBC_2.38 pthread_cond_broadcast F
GLIBC_2.38 pthread_cond_clockwait F
GLIBC_2.38 pthread_cond_destroy F
@@ -1563,6 +1564,7 @@ GLIBC_2.38 pthread_getconcurrency F
GLIBC_2.38 pthread_getcpuclockid F
GLIBC_2.38 pthread_getschedparam F
GLIBC_2.38 pthread_getspecific F
+GLIBC_2.38 pthread_join F
GLIBC_2.38 pthread_key_create F
GLIBC_2.38 pthread_key_delete F
GLIBC_2.38 pthread_kill F
@@ -1617,6 +1619,8 @@ GLIBC_2.38 pthread_setschedprio F
GLIBC_2.38 pthread_setspecific F
GLIBC_2.38 pthread_sigmask F
GLIBC_2.38 pthread_testcancel F
+GLIBC_2.38 pthread_timedjoin_np F
+GLIBC_2.38 pthread_tryjoin_np F
GLIBC_2.38 pthread_yield F
GLIBC_2.38 ptrace F
GLIBC_2.38 ptsname F
@@ -2329,15 +2333,19 @@ GLIBC_2.42 uimaxabs F
GLIBC_2.42 ulabs F
GLIBC_2.42 ullabs F
GLIBC_2.43 pthread_cancel F
+GLIBC_2.43 pthread_clockjoin_np F
GLIBC_2.43 pthread_detach F
GLIBC_2.43 pthread_getattr_np F
GLIBC_2.43 pthread_getconcurrency F
GLIBC_2.43 pthread_getcpuclockid F
+GLIBC_2.43 pthread_join F
GLIBC_2.43 pthread_kill F
GLIBC_2.43 pthread_mutex_transfer_np F
GLIBC_2.43 pthread_setconcurrency F
GLIBC_2.43 pthread_setschedprio F
GLIBC_2.43 pthread_testcancel F
+GLIBC_2.43 pthread_timedjoin_np F
+GLIBC_2.43 pthread_tryjoin_np F
GLIBC_2.43 pthread_yield F
HURD_CTHREADS_0.3 __cthread_getspecific F
HURD_CTHREADS_0.3 __cthread_keycreate F
diff --git a/sysdeps/mach/hurd/x86_64/libpthread.abilist b/sysdeps/mach/hurd/x86_64/libpthread.abilist
index 6dfca3f..5caa7bc 100644
--- a/sysdeps/mach/hurd/x86_64/libpthread.abilist
+++ b/sysdeps/mach/hurd/x86_64/libpthread.abilist
@@ -35,18 +35,14 @@ GLIBC_2.38 mtx_lock F
GLIBC_2.38 mtx_timedlock F
GLIBC_2.38 mtx_trylock F
GLIBC_2.38 mtx_unlock F
-GLIBC_2.38 pthread_clockjoin_np F
GLIBC_2.38 pthread_create F
GLIBC_2.38 pthread_hurd_cond_timedwait_np F
GLIBC_2.38 pthread_hurd_cond_wait_np F
-GLIBC_2.38 pthread_join F
GLIBC_2.38 pthread_spin_destroy F
GLIBC_2.38 pthread_spin_init F
GLIBC_2.38 pthread_spin_lock F
GLIBC_2.38 pthread_spin_trylock F
GLIBC_2.38 pthread_spin_unlock F
-GLIBC_2.38 pthread_timedjoin_np F
-GLIBC_2.38 pthread_tryjoin_np F
GLIBC_2.38 sem_clockwait F
GLIBC_2.38 sem_close F
GLIBC_2.38 sem_destroy F