From: gfleury Date: Thu, 19 Dec 2024 20:37:22 +0000 (+0200) Subject: htl: move pthread_cond_destroy into libc. X-Git-Tag: glibc-2.41~212 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=917a131ab94f930ef5022f0042af95d931264b4a;p=thirdparty%2Fglibc.git htl: move pthread_cond_destroy into libc. Signed-off-by: gfleury Message-ID: <20241219203727.669825-4-gfleury@disroot.org> --- diff --git a/htl/Makefile b/htl/Makefile index 168b211905..c61112d667 100644 --- a/htl/Makefile +++ b/htl/Makefile @@ -91,7 +91,6 @@ libpthread-routines := \ pt-rwlock-timedrdlock \ pt-rwlock-timedwrlock \ pt-rwlock-unlock \ - pt-cond-destroy \ pt-cond-brdcast \ pt-cond-signal \ pt-cond-wait \ @@ -195,6 +194,7 @@ routines := \ pt-attr-setstackaddr \ pt-attr-setstacksize \ pt-cond \ + pt-cond-destroy \ pt-cond-init \ pt-condattr-destroy \ pt-condattr-getclock \ diff --git a/htl/Versions b/htl/Versions index 996626df2f..30f7d03aeb 100644 --- a/htl/Versions +++ b/htl/Versions @@ -26,6 +26,7 @@ libc { pthread_attr_setscope; pthread_attr_setschedparam; pthread_attr_init; + pthread_cond_destroy; pthread_cond_init; pthread_condattr_getclock; pthread_condattr_init; @@ -95,6 +96,7 @@ libc { __pthread_attr_setstacksize; __pthread_attr_setstackaddr; __pthread_attr_setstack; + __pthread_cond_destroy; __pthread_cond_init; __pthread_condattr_init; __pthread_default_condattr; @@ -136,7 +138,7 @@ libpthread { pthread_cancel; - pthread_cond_broadcast; pthread_cond_destroy; + pthread_cond_broadcast; pthread_cond_signal; pthread_cond_timedwait; pthread_cond_wait; pthread_create; pthread_detach; pthread_exit; diff --git a/htl/forward.c b/htl/forward.c index eb83eaeda1..7731b84d04 100644 --- a/htl/forward.c +++ b/htl/forward.c @@ -54,7 +54,6 @@ name decl \ FORWARD2 (name, int, decl, params, return defretval) FORWARD (pthread_cond_broadcast, (pthread_cond_t *cond), (cond), 0) -FORWARD (pthread_cond_destroy, (pthread_cond_t *cond), (cond), 0) FORWARD (pthread_cond_signal, (pthread_cond_t *cond), (cond), 0) FORWARD (pthread_cond_wait, (pthread_cond_t *cond, pthread_mutex_t *mutex), (cond, mutex), 0) diff --git a/htl/pt-initialize.c b/htl/pt-initialize.c index 051bc09e94..1b147b947a 100644 --- a/htl/pt-initialize.c +++ b/htl/pt-initialize.c @@ -28,7 +28,6 @@ #if IS_IN (libpthread) static const struct pthread_functions pthread_functions = { .ptr_pthread_cond_broadcast = __pthread_cond_broadcast, - .ptr_pthread_cond_destroy = __pthread_cond_destroy, .ptr_pthread_cond_signal = __pthread_cond_signal, .ptr_pthread_cond_wait = __pthread_cond_wait, .ptr_pthread_cond_timedwait = __pthread_cond_timedwait, diff --git a/sysdeps/htl/pt-cond-destroy.c b/sysdeps/htl/pt-cond-destroy.c index e3660dbb5d..066dd1f424 100644 --- a/sysdeps/htl/pt-cond-destroy.c +++ b/sysdeps/htl/pt-cond-destroy.c @@ -18,6 +18,7 @@ #include #include +#include int __pthread_cond_destroy (pthread_cond_t *cond) @@ -43,5 +44,9 @@ __pthread_cond_destroy (pthread_cond_t *cond) return 0; } +libc_hidden_def (__pthread_cond_destroy) +versioned_symbol (libc, __pthread_cond_destroy, pthread_cond_destroy, GLIBC_2_21); -weak_alias (__pthread_cond_destroy, pthread_cond_destroy); +#if OTHER_SHLIB_COMPAT (libpthread, GLIBC_2_12, GLIBC_2_21) +compat_symbol (libc, __pthread_cond_destroy, pthread_cond_destroy, GLIBC_2_12); +#endif diff --git a/sysdeps/htl/pthread-functions.h b/sysdeps/htl/pthread-functions.h index 87e75ca804..99510615dd 100644 --- a/sysdeps/htl/pthread-functions.h +++ b/sysdeps/htl/pthread-functions.h @@ -22,7 +22,6 @@ #include int __pthread_cond_broadcast (pthread_cond_t *); -int __pthread_cond_destroy (pthread_cond_t *); int __pthread_cond_signal (pthread_cond_t *); int __pthread_cond_wait (pthread_cond_t *, pthread_mutex_t *); int __pthread_cond_timedwait (pthread_cond_t *, pthread_mutex_t *, @@ -55,7 +54,6 @@ int _cthreads_ftrylockfile (FILE *); struct pthread_functions { int (*ptr_pthread_cond_broadcast) (pthread_cond_t *); - int (*ptr_pthread_cond_destroy) (pthread_cond_t *); int (*ptr_pthread_cond_signal) (pthread_cond_t *); int (*ptr_pthread_cond_wait) (pthread_cond_t *, pthread_mutex_t *); int (*ptr_pthread_cond_timedwait) (pthread_cond_t *, pthread_mutex_t *, diff --git a/sysdeps/htl/pthreadP.h b/sysdeps/htl/pthreadP.h index 64c86623c7..6d469b7eff 100644 --- a/sysdeps/htl/pthreadP.h +++ b/sysdeps/htl/pthreadP.h @@ -56,6 +56,7 @@ extern int __pthread_cond_clockwait (pthread_cond_t *cond, const struct timespec *abstime) __nonnull ((1, 2, 4)); extern int __pthread_cond_destroy (pthread_cond_t *cond); +libc_hidden_proto (__pthread_cond_destroy); extern int __pthread_sigmask (int, const sigset_t *, sigset_t *); libc_hidden_proto (__pthread_sigmask); diff --git a/sysdeps/htl/timer_routines.c b/sysdeps/htl/timer_routines.c index 0992ea3911..7e2a56139e 100644 --- a/sysdeps/htl/timer_routines.c +++ b/sysdeps/htl/timer_routines.c @@ -211,7 +211,7 @@ static void thread_deinit (struct thread_node *thread) { assert (list_isempty (&thread->timer_queue)); - pthread_cond_destroy (&thread->cond); + __pthread_cond_destroy (&thread->cond); } diff --git a/sysdeps/mach/hurd/i386/libc.abilist b/sysdeps/mach/hurd/i386/libc.abilist index d5520a0658..e251d09f5d 100644 --- a/sysdeps/mach/hurd/i386/libc.abilist +++ b/sysdeps/mach/hurd/i386/libc.abilist @@ -49,6 +49,7 @@ GLIBC_2.12 pthread_attr_setscope F GLIBC_2.12 pthread_attr_setstack F GLIBC_2.12 pthread_attr_setstackaddr F GLIBC_2.12 pthread_attr_setstacksize F +GLIBC_2.12 pthread_cond_destroy F GLIBC_2.12 pthread_cond_init F GLIBC_2.12 pthread_condattr_destroy F GLIBC_2.12 pthread_condattr_getclock F diff --git a/sysdeps/mach/hurd/i386/libpthread.abilist b/sysdeps/mach/hurd/i386/libpthread.abilist index 77eddcfe93..b9d13b27eb 100644 --- a/sysdeps/mach/hurd/i386/libpthread.abilist +++ b/sysdeps/mach/hurd/i386/libpthread.abilist @@ -31,7 +31,6 @@ GLIBC_2.12 pthread_barrierattr_init F GLIBC_2.12 pthread_barrierattr_setpshared F GLIBC_2.12 pthread_cancel F GLIBC_2.12 pthread_cond_broadcast F -GLIBC_2.12 pthread_cond_destroy F GLIBC_2.12 pthread_cond_signal F GLIBC_2.12 pthread_cond_timedwait F GLIBC_2.12 pthread_cond_wait F diff --git a/sysdeps/mach/hurd/x86_64/libpthread.abilist b/sysdeps/mach/hurd/x86_64/libpthread.abilist index 25bcc9dbea..154689e859 100644 --- a/sysdeps/mach/hurd/x86_64/libpthread.abilist +++ b/sysdeps/mach/hurd/x86_64/libpthread.abilist @@ -50,7 +50,6 @@ 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 GLIBC_2.38 pthread_cond_signal F GLIBC_2.38 pthread_cond_timedwait F GLIBC_2.38 pthread_cond_wait F