diff options
| author | Florian Weimer <fweimer@redhat.com> | 2021-05-11 11:08:00 +0200 |
|---|---|---|
| committer | Florian Weimer <fweimer@redhat.com> | 2021-05-11 11:24:39 +0200 |
| commit | df65f897e9501aa5b64a5cbcb101301715f2ec2f (patch) | |
| tree | ed8e6ba638dde4a447fb1a30107a62f8287dcb4f | |
| parent | 8fbb33b3f74560ea3c74d289bdf59cffce52b463 (diff) | |
| download | glibc-df65f897e9501aa5b64a5cbcb101301715f2ec2f.tar.xz glibc-df65f897e9501aa5b64a5cbcb101301715f2ec2f.zip | |
nptl: Move pthread_detach, thrd_detach into libc
The symbols were moved using scripts/move-symbol-to-libc.py.
Reviewed-by: Adhemerval Zanella <adhemerval.zanella@linaro.org>
67 files changed, 157 insertions, 66 deletions
diff --git a/nptl/Makefile b/nptl/Makefile index 9c69b864f0..5e0347b5b1 100644 --- a/nptl/Makefile +++ b/nptl/Makefile @@ -95,6 +95,7 @@ routines = \ pthread_condattr_init \ pthread_condattr_setclock \ pthread_condattr_setpshared \ + pthread_detach \ pthread_equal \ pthread_exit \ pthread_getaffinity \ @@ -198,7 +199,6 @@ libpthread-routines = \ pthread_cancel \ pthread_clockjoin \ pthread_create \ - pthread_detach \ pthread_getattr_default_np \ pthread_getconcurrency \ pthread_getcpuclockid \ diff --git a/nptl/Versions b/nptl/Versions index da610a4803..46ae34a1a2 100644 --- a/nptl/Versions +++ b/nptl/Versions @@ -37,6 +37,7 @@ libc { pthread_cond_wait; pthread_condattr_destroy; pthread_condattr_init; + pthread_detach; pthread_equal; pthread_exit; pthread_getschedparam; @@ -186,6 +187,7 @@ libc { mtx_trylock; mtx_unlock; thrd_current; + thrd_detach; thrd_equal; thrd_exit; thrd_sleep; @@ -240,6 +242,7 @@ libc { pthread_condattr_getpshared; pthread_condattr_setclock; pthread_condattr_setpshared; + pthread_detach; pthread_getspecific; pthread_key_create; pthread_key_delete; @@ -295,6 +298,7 @@ libc { sem_trywait; sem_unlink; sem_wait; + thrd_detach; thrd_exit; tss_create; tss_delete; @@ -365,7 +369,6 @@ libpthread { funlockfile; pthread_cancel; pthread_create; - pthread_detach; pthread_join; pthread_sigmask; } @@ -449,7 +452,6 @@ libpthread { # C11 thread symbols. GLIBC_2.28 { thrd_create; - thrd_detach; thrd_join; } diff --git a/nptl/pthreadP.h b/nptl/pthreadP.h index d580f71a38..34d133b187 100644 --- a/nptl/pthreadP.h +++ b/nptl/pthreadP.h @@ -529,6 +529,7 @@ extern int __pthread_atfork (void (*prepare) (void), void (*parent) (void), extern pthread_t __pthread_self (void); extern int __pthread_equal (pthread_t thread1, pthread_t thread2); extern int __pthread_detach (pthread_t th); +libc_hidden_proto (__pthread_detach) extern int __pthread_cancel (pthread_t th); extern int __pthread_kill (pthread_t threadid, int signo); extern void __pthread_exit (void *value) __attribute__ ((__noreturn__)); diff --git a/nptl/pthread_detach.c b/nptl/pthread_detach.c index 410255bbe1..ac50db9b0e 100644 --- a/nptl/pthread_detach.c +++ b/nptl/pthread_detach.c @@ -19,10 +19,10 @@ #include <errno.h> #include "pthreadP.h" #include <atomic.h> - +#include <shlib-compat.h> int -__pthread_detach (pthread_t th) +___pthread_detach (pthread_t th) { struct pthread *pd = (struct pthread *) th; @@ -53,4 +53,12 @@ __pthread_detach (pthread_t th) return result; } -weak_alias (__pthread_detach, pthread_detach) +versioned_symbol (libc, ___pthread_detach, pthread_detach, GLIBC_2_34); +libc_hidden_ver (___pthread_detach, __pthread_detach) +#ifndef SHARED +strong_alias (___pthread_detach, __pthread_detach) +#endif + +#if OTHER_SHLIB_COMPAT (libpthread, GLIBC_2_0, GLIBC_2_34) +compat_symbol (libc, ___pthread_detach, pthread_detach, GLIBC_2_0); +#endif diff --git a/sysdeps/pthread/Makefile b/sysdeps/pthread/Makefile index 54bb11bab9..ec8e3af577 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_detach thrd_join +libpthread-routines += thrd_create thrd_join $(libpthread-routines-var) += \ call_once \ @@ -47,6 +47,7 @@ $(libpthread-routines-var) += \ mtx_timedlock \ mtx_trylock \ mtx_unlock \ + thrd_detach \ thrd_exit \ tss_create \ tss_delete \ diff --git a/sysdeps/pthread/thrd_detach.c b/sysdeps/pthread/thrd_detach.c index cbc63f57a2..29ac011d5b 100644 --- a/sysdeps/pthread/thrd_detach.c +++ b/sysdeps/pthread/thrd_detach.c @@ -17,12 +17,21 @@ <https://www.gnu.org/licenses/>. */ #include "thrd_priv.h" +#include <shlib-compat.h> int -thrd_detach (thrd_t thr) +__thrd_detach (thrd_t thr) { int err_code; err_code = __pthread_detach (thr); return thrd_err_map (err_code); } +#if PTHREAD_IN_LIBC +versioned_symbol (libc, __thrd_detach, thrd_detach, GLIBC_2_34); +# if OTHER_SHLIB_COMPAT (libpthread, GLIBC_2_28, GLIBC_2_34) +compat_symbol (libc, __thrd_detach, thrd_detach, GLIBC_2_28); +# endif +#else /* !PTHREAD_IN_LIBC */ +strong_alias (__thrd_detach, thrd_detach) +#endif diff --git a/sysdeps/unix/sysv/linux/aarch64/libc.abilist b/sysdeps/unix/sysv/linux/aarch64/libc.abilist index caee529c98..b5b0b44697 100644 --- a/sysdeps/unix/sysv/linux/aarch64/libc.abilist +++ b/ |
