]> git.ipfire.org Git - thirdparty/glibc.git/commitdiff
htl: move pthread_cond_timedwait, pthread_cond_clockwait, pthread_cond_wait into...
authorgfleury <gfleury@disroot.org>
Thu, 19 Dec 2024 20:37:27 +0000 (22:37 +0200)
committerSamuel Thibault <samuel.thibault@ens-lyon.org>
Sun, 22 Dec 2024 22:37:30 +0000 (23:37 +0100)
Message-ID: <20241219203727.669825-9-gfleury@disroot.org>

13 files changed:
htl/Makefile
htl/Versions
htl/forward.c
htl/pt-initialize.c
sysdeps/htl/pt-cond-timedwait.c
sysdeps/htl/pt-cond-wait.c
sysdeps/htl/pthread-functions.h
sysdeps/htl/pthreadP.h
sysdeps/htl/timer_routines.c
sysdeps/mach/hurd/i386/libc.abilist
sysdeps/mach/hurd/i386/libpthread.abilist
sysdeps/mach/hurd/x86_64/libc.abilist
sysdeps/mach/hurd/x86_64/libpthread.abilist

index 1c454d4d3ef6d093c4b291bff212f3bba30a3bef..8ce32d17024050fab2d2e1c3f8d84d34b4d6920e 100644 (file)
@@ -90,8 +90,6 @@ libpthread-routines := \
   pt-rwlock-timedrdlock \
   pt-rwlock-timedwrlock \
   pt-rwlock-unlock \
-  pt-cond-wait \
-  pt-cond-timedwait \
   pt-hurd-cond-wait \
   pt-hurd-cond-timedwait \
   pt-stack-alloc \
@@ -193,6 +191,8 @@ routines := \
   pt-cond-destroy \
   pt-cond-init \
   pt-cond-signal \
+  pt-cond-timedwait \
+  pt-cond-wait \
   pt-condattr-destroy \
   pt-condattr-getclock \
   pt-condattr-getpshared \
index 95cf7fe4c28a15cdfb02d704c9a61929b44b5182..1492a2a1ca452a86fa9d31e8f9e77909413d5f1c 100644 (file)
@@ -30,6 +30,8 @@ libc {
     pthread_cond_destroy;
     pthread_cond_init;
     pthread_cond_signal;
+    pthread_cond_timedwait;
+    pthread_cond_wait;
     pthread_condattr_getclock;
     pthread_condattr_init;
     pthread_condattr_destroy;
@@ -64,6 +66,8 @@ libc {
   # C11 thread symbols.
   GLIBC_2.32 {
     thrd_current; thrd_equal; thrd_sleep; thrd_yield;
+
+    pthread_cond_clockwait;
   }
 
   GLIBC_2.41 {
@@ -103,7 +107,10 @@ libc {
     __pthread_cond_broadcast;
     __pthread_cond_destroy;
     __pthread_cond_init;
+    __pthread_cond_clockwait;
     __pthread_cond_signal;
+    __pthread_cond_timedwait;
+    __pthread_cond_wait;
     __pthread_condattr_init;
     __pthread_default_condattr;
     __pthread_mutex_checklocked;
@@ -147,8 +154,6 @@ libpthread {
 
     pthread_cancel;
 
-    pthread_cond_timedwait; pthread_cond_wait;
-
     pthread_create; pthread_detach; pthread_exit;
 
     pthread_getattr_np;
@@ -214,8 +219,6 @@ libpthread {
     cnd_broadcast; cnd_destroy; cnd_init; cnd_signal; cnd_timedwait; cnd_wait;
     tss_create; tss_delete; tss_get; tss_set;
 
-    pthread_cond_clockwait;
-
     pthread_mutexattr_getrobust; pthread_mutexattr_getrobust_np;
     pthread_mutexattr_setrobust; pthread_mutexattr_setrobust_np;
 
index 78758cef620830c71ff75d6e67ae75838e35dd02..29f5528099c84b4cc2ebe442b08de41209b0953b 100644 (file)
@@ -53,12 +53,6 @@ name decl                                                                  \
 #define FORWARD(name, decl, params, defretval) \
   FORWARD2 (name, int, decl, params, return defretval)
 
-FORWARD (pthread_cond_wait, (pthread_cond_t *cond, pthread_mutex_t *mutex),
-        (cond, mutex), 0)
-FORWARD (pthread_cond_timedwait,
-        (pthread_cond_t *cond, pthread_mutex_t *mutex,
-         const struct timespec *abstime), (cond, mutex, abstime), 0)
-
 /* Use an alias to avoid warning, as pthread_exit is declared noreturn.  */
 FORWARD_NORETURN (__pthread_exit, void, (void *retval), (retval),
                  exit (EXIT_SUCCESS))
index cf312f1cd632d9a45e70d38afc4d0362ac093ca2..40eeb7e776e999c56c029a45ab432adea703c227 100644 (file)
@@ -27,8 +27,6 @@
 
 #if IS_IN (libpthread)
 static const struct pthread_functions pthread_functions = {
-  .ptr_pthread_cond_wait = __pthread_cond_wait,
-  .ptr_pthread_cond_timedwait = __pthread_cond_timedwait,
   .ptr___pthread_exit = __pthread_exit,
   .ptr_pthread_mutex_destroy = __pthread_mutex_destroy,
   .ptr_pthread_mutex_init = __pthread_mutex_init,
index 78853da89b7e9247e98e9225cccca22cead965eb..dc256b8f746b03e0903f0e01c9d3b60a888b3ca4 100644 (file)
@@ -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
 {
index d00547f3a5a81bb258125f86b02bc751ae8bda99..850afba1adb3d15476dc795b0da169673e821b7f 100644 (file)
@@ -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
index fafefa5a4c942edf8b064216b276010a3b5067eb..ff93c22a65170cb80ae8b369aa655a4a82e04745 100644 (file)
@@ -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 *,
index 3c9f38c73438dced24d48449a17c5f774e8caf1c..b5a9f0cba4aae33237f9e60b3a3655569bb08c50 100644 (file)
@@ -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 *);
index 1244ce868ac664e5cb6a3792e5d72f99193ffb48..4117545bac85e8af68b2ec71305adb1b9a2af604 100644 (file)
@@ -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.  */
index e2f18b81721c1f0e5da2533c9c552e647fe22b0e..b48fa38edf9c7f0cc33a9cf5a8a6ae6d5f17c360 100644 (file)
@@ -53,6 +53,8 @@ GLIBC_2.12 pthread_cond_broadcast F
 GLIBC_2.12 pthread_cond_destroy F
 GLIBC_2.12 pthread_cond_init F
 GLIBC_2.12 pthread_cond_signal F
+GLIBC_2.12 pthread_cond_timedwait F
+GLIBC_2.12 pthread_cond_wait F
 GLIBC_2.12 pthread_condattr_destroy F
 GLIBC_2.12 pthread_condattr_getclock F
 GLIBC_2.12 pthread_condattr_getpshared F
@@ -2250,6 +2252,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_cond_clockwait F
 GLIBC_2.32 sigabbrev_np F
 GLIBC_2.32 sigdescr_np F
 GLIBC_2.32 strerrordesc_np F
index 7c61af5fa11570f98056e4b2ef14cb329daae17d..f90794bc5c18083b758d4c1f6cde11a03ceba0a0 100644 (file)
@@ -30,8 +30,6 @@ GLIBC_2.12 pthread_barrierattr_getpshared F
 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_timedwait F
-GLIBC_2.12 pthread_cond_wait F
 GLIBC_2.12 pthread_create F
 GLIBC_2.12 pthread_detach F
 GLIBC_2.12 pthread_exit F
@@ -119,7 +117,6 @@ 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_cond_clockwait F
 GLIBC_2.32 pthread_mutex_clocklock F
 GLIBC_2.32 pthread_mutex_consistent F
 GLIBC_2.32 pthread_mutex_consistent_np F
index b331c26effb84d21d10fa95796207f90897324e6..1cd5f99297bf6efde0331fdb42b3c951b19fa302 100644 (file)
@@ -1532,6 +1532,7 @@ GLIBC_2.38 pthread_attr_setstack F
 GLIBC_2.38 pthread_attr_setstackaddr F
 GLIBC_2.38 pthread_attr_setstacksize 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_init F
 GLIBC_2.38 pthread_cond_signal F
index 5b2da07745dd93c2fae6855f8041e64d990bc4df..6262dfa86cd1beff9aee2ce9c4d59d7f32e3715f 100644 (file)
@@ -48,9 +48,6 @@ 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_clockwait F
-GLIBC_2.38 pthread_cond_timedwait F
-GLIBC_2.38 pthread_cond_wait F
 GLIBC_2.38 pthread_create F
 GLIBC_2.38 pthread_detach F
 GLIBC_2.38 pthread_exit F