diff options
| author | gfleury <gfleury@disroot.org> | 2024-12-19 22:37:23 +0200 |
|---|---|---|
| committer | Samuel Thibault <samuel.thibault@ens-lyon.org> | 2024-12-22 23:34:27 +0100 |
| commit | 3089d23517a0d93c645edd5129e08e8432fc3563 (patch) | |
| tree | 4be596f258cc12c9d7b0490e8ab67c25dcc7785e /sysdeps/htl | |
| parent | 917a131ab94f930ef5022f0042af95d931264b4a (diff) | |
| download | glibc-3089d23517a0d93c645edd5129e08e8432fc3563.tar.xz glibc-3089d23517a0d93c645edd5129e08e8432fc3563.zip | |
htl: move pthread_cond_broadcast into libc.
Signed-off-by: gfleury <gfleury@disroot.org>
Message-ID: <20241219203727.669825-5-gfleury@disroot.org>
Diffstat (limited to 'sysdeps/htl')
| -rw-r--r-- | sysdeps/htl/pt-cond-brdcast.c | 8 | ||||
| -rw-r--r-- | sysdeps/htl/pthread-functions.h | 2 | ||||
| -rw-r--r-- | sysdeps/htl/pthreadP.h | 1 | ||||
| -rw-r--r-- | sysdeps/htl/timer_routines.c | 6 |
4 files changed, 10 insertions, 7 deletions
diff --git a/sysdeps/htl/pt-cond-brdcast.c b/sysdeps/htl/pt-cond-brdcast.c index a0071740df..baa4fc5eec 100644 --- a/sysdeps/htl/pt-cond-brdcast.c +++ b/sysdeps/htl/pt-cond-brdcast.c @@ -17,7 +17,7 @@ <https://www.gnu.org/licenses/>. */ #include <pthread.h> - +#include <shlib-compat.h> #include <pt-internal.h> /* Unblock all threads that are blocked on condition variable COND. */ @@ -40,5 +40,9 @@ __pthread_cond_broadcast (pthread_cond_t *cond) return 0; } +libc_hidden_def (__pthread_cond_broadcast) +versioned_symbol (libc, __pthread_cond_broadcast, pthread_cond_broadcast, GLIBC_2_21); -weak_alias (__pthread_cond_broadcast, pthread_cond_broadcast); +#if OTHER_SHLIB_COMPAT (libpthread, GLIBC_2_12, GLIBC_2_21) +compat_symbol (libc, __pthread_cond_broadcast, pthread_cond_broadcast, GLIBC_2_12); +#endif diff --git a/sysdeps/htl/pthread-functions.h b/sysdeps/htl/pthread-functions.h index 99510615dd..c09a39823e 100644 --- a/sysdeps/htl/pthread-functions.h +++ b/sysdeps/htl/pthread-functions.h @@ -21,7 +21,6 @@ #include <pthread.h> -int __pthread_cond_broadcast (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 *, @@ -53,7 +52,6 @@ int _cthreads_ftrylockfile (FILE *); so if possible avoid breaking it and append new hooks to the end. */ struct pthread_functions { - int (*ptr_pthread_cond_broadcast) (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 6d469b7eff..4138abdd37 100644 --- a/sysdeps/htl/pthreadP.h +++ b/sysdeps/htl/pthreadP.h @@ -46,6 +46,7 @@ extern int __pthread_cond_init (pthread_cond_t *cond, libc_hidden_proto (__pthread_cond_init) extern int __pthread_cond_signal (pthread_cond_t *cond); extern int __pthread_cond_broadcast (pthread_cond_t *cond); +libc_hidden_proto (__pthread_cond_broadcast); extern int __pthread_cond_wait (pthread_cond_t *cond, pthread_mutex_t *mutex); extern int __pthread_cond_timedwait (pthread_cond_t *cond, pthread_mutex_t *mutex, diff --git a/sysdeps/htl/timer_routines.c b/sysdeps/htl/timer_routines.c index 7e2a56139e..1244ce868a 100644 --- a/sysdeps/htl/timer_routines.c +++ b/sysdeps/htl/timer_routines.c @@ -280,7 +280,7 @@ thread_cleanup (void *val) pthread_mutex_unlock (&__timer_mutex); /* Unblock potentially blocked timer_delete(). */ - pthread_cond_broadcast (&thread->cond); + __pthread_cond_broadcast (&thread->cond); } } @@ -338,7 +338,7 @@ thread_expire_timer (struct thread_node *self, struct timer_node *timer) self->current_timer = 0; - pthread_cond_broadcast (&self->cond); + __pthread_cond_broadcast (&self->cond); } @@ -486,7 +486,7 @@ __timer_thread_start (struct thread_node *thread) void __timer_thread_wakeup (struct thread_node *thread) { - pthread_cond_broadcast (&thread->cond); + __pthread_cond_broadcast (&thread->cond); } |
