diff options
| author | gfleury <gfleury@disroot.org> | 2024-12-19 22:37:27 +0200 |
|---|---|---|
| committer | Samuel Thibault <samuel.thibault@ens-lyon.org> | 2024-12-22 23:37:30 +0100 |
| commit | f646be6ff6e4f21e68e579904362d0d110fb3f84 (patch) | |
| tree | c3d9ae38d5d54dc35aeeb5da82fc4f0669a1f9ee /sysdeps/htl | |
| parent | ba8522542fc2f1fa0a928432be91b9456ad745da (diff) | |
| download | glibc-f646be6ff6e4f21e68e579904362d0d110fb3f84.tar.xz glibc-f646be6ff6e4f21e68e579904362d0d110fb3f84.zip | |
htl: move pthread_cond_timedwait, pthread_cond_clockwait, pthread_cond_wait into libc.
Message-ID: <20241219203727.669825-9-gfleury@disroot.org>
Diffstat (limited to 'sysdeps/htl')
| -rw-r--r-- | sysdeps/htl/pt-cond-timedwait.c | 10 | ||||
| -rw-r--r-- | sysdeps/htl/pt-cond-wait.c | 8 | ||||
| -rw-r--r-- | sysdeps/htl/pthread-functions.h | 6 | ||||
| -rw-r--r-- | sysdeps/htl/pthreadP.h | 3 | ||||
| -rw-r--r-- | sysdeps/htl/timer_routines.c | 4 |
5 files changed, 18 insertions, 13 deletions
diff --git a/sysdeps/htl/pt-cond-timedwait.c b/sysdeps/htl/pt-cond-timedwait.c index 78853da89b..dc256b8f74 100644 --- a/sysdeps/htl/pt-cond-timedwait.c +++ b/sysdeps/htl/pt-cond-timedwait.c @@ -17,7 +17,7 @@ <https://www.gnu.org/licenses/>. */ #include <pthread.h> - +#include <shlib-compat.h> #include <pt-internal.h> #include <pthreadP.h> #include <time.h> @@ -34,8 +34,12 @@ __pthread_cond_timedwait (pthread_cond_t *cond, { return __pthread_cond_timedwait_internal (cond, mutex, -1, abstime); } +libc_hidden_def (__pthread_cond_timedwait) +versioned_symbol (libc, __pthread_cond_timedwait, pthread_cond_timedwait, GLIBC_2_21); -weak_alias (__pthread_cond_timedwait, pthread_cond_timedwait); +#if OTHER_SHLIB_COMPAT (libpthread, GLIBC_2_12, GLIBC_2_21) +compat_symbol (libc, __pthread_cond_timedwait, pthread_cond_timedwait, GLIBC_2_12); +#endif int __pthread_cond_clockwait (pthread_cond_t *cond, @@ -45,8 +49,8 @@ __pthread_cond_clockwait (pthread_cond_t *cond, { return __pthread_cond_timedwait_internal (cond, mutex, clockid, abstime); } - weak_alias (__pthread_cond_clockwait, pthread_cond_clockwait); +libc_hidden_def (__pthread_cond_clockwait) struct cancel_ctx { diff --git a/sysdeps/htl/pt-cond-wait.c b/sysdeps/htl/pt-cond-wait.c index d00547f3a5..850afba1ad 100644 --- a/sysdeps/htl/pt-cond-wait.c +++ b/sysdeps/htl/pt-cond-wait.c @@ -17,7 +17,7 @@ <https://www.gnu.org/licenses/>. */ #include <pthread.h> - +#include <shlib-compat.h> #include <pt-internal.h> /* Implemented in pt-cond-timedwait.c. */ @@ -35,5 +35,9 @@ __pthread_cond_wait (pthread_cond_t *cond, pthread_mutex_t *mutex) { return __pthread_cond_timedwait_internal (cond, mutex, -1, 0); } +libc_hidden_def (__pthread_cond_wait) +versioned_symbol (libc, __pthread_cond_wait, pthread_cond_wait, GLIBC_2_21); -weak_alias (__pthread_cond_wait, pthread_cond_wait); +#if OTHER_SHLIB_COMPAT (libpthread, GLIBC_2_12, GLIBC_2_21) +compat_symbol (libc, __pthread_cond_wait, pthread_cond_wait, GLIBC_2_12); +#endif diff --git a/sysdeps/htl/pthread-functions.h b/sysdeps/htl/pthread-functions.h index fafefa5a4c..ff93c22a65 100644 --- a/sysdeps/htl/pthread-functions.h +++ b/sysdeps/htl/pthread-functions.h @@ -21,9 +21,6 @@ #include <pthread.h> -int __pthread_cond_wait (pthread_cond_t *, pthread_mutex_t *); -int __pthread_cond_timedwait (pthread_cond_t *, pthread_mutex_t *, - const struct timespec *); void __pthread_exit (void *) __attribute__ ((__noreturn__)); int _pthread_mutex_destroy (pthread_mutex_t *); int _pthread_mutex_init (pthread_mutex_t *, @@ -51,9 +48,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_wait) (pthread_cond_t *, pthread_mutex_t *); - int (*ptr_pthread_cond_timedwait) (pthread_cond_t *, pthread_mutex_t *, - const struct timespec *); void (*ptr___pthread_exit) (void *) __attribute__ ((__noreturn__)); int (*ptr_pthread_mutex_destroy) (pthread_mutex_t *); int (*ptr_pthread_mutex_init) (pthread_mutex_t *, diff --git a/sysdeps/htl/pthreadP.h b/sysdeps/htl/pthreadP.h index 3c9f38c734..b5a9f0cba4 100644 --- a/sysdeps/htl/pthreadP.h +++ b/sysdeps/htl/pthreadP.h @@ -49,14 +49,17 @@ libc_hidden_proto (__pthread_cond_signal); 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); +libc_hidden_proto (__pthread_cond_wait); extern int __pthread_cond_timedwait (pthread_cond_t *cond, pthread_mutex_t *mutex, const struct timespec *abstime); +libc_hidden_proto (__pthread_cond_timedwait); extern int __pthread_cond_clockwait (pthread_cond_t *cond, pthread_mutex_t *mutex, clockid_t clockid, const struct timespec *abstime) __nonnull ((1, 2, 4)); +libc_hidden_proto (__pthread_cond_clockwait); 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 *); diff --git a/sysdeps/htl/timer_routines.c b/sysdeps/htl/timer_routines.c index 1244ce868a..4117545bac 100644 --- a/sysdeps/htl/timer_routines.c +++ b/sysdeps/htl/timer_routines.c @@ -418,10 +418,10 @@ thread_func (void *arg) head of the queue must wake up the thread by broadcasting this condition variable. */ if (timer != NULL) - pthread_cond_timedwait (&self->cond, &__timer_mutex, + __pthread_cond_timedwait (&self->cond, &__timer_mutex, &timer->expirytime); else - pthread_cond_wait (&self->cond, &__timer_mutex); + __pthread_cond_wait (&self->cond, &__timer_mutex); } /* This macro will never be executed since the while loop loops forever - but we have to add it for proper nesting. */ |
