]> git.ipfire.org Git - thirdparty/glibc.git/commitdiff
htl: move pthread_cond_broadcast into libc.
authorgfleury <gfleury@disroot.org>
Thu, 19 Dec 2024 20:37:23 +0000 (22:37 +0200)
committerSamuel Thibault <samuel.thibault@ens-lyon.org>
Sun, 22 Dec 2024 22:34:27 +0000 (23:34 +0100)
Signed-off-by: gfleury <gfleury@disroot.org>
Message-ID: <20241219203727.669825-5-gfleury@disroot.org>

htl/Makefile
htl/Versions
htl/forward.c
htl/pt-initialize.c
sysdeps/htl/pt-cond-brdcast.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/libpthread.abilist

index c61112d66783950dffd4215a37d106ff4e5a56d0..629a8a5359da3a8f0c6135ee9b31006025e359de 100644 (file)
@@ -91,7 +91,6 @@ libpthread-routines := \
   pt-rwlock-timedrdlock \
   pt-rwlock-timedwrlock \
   pt-rwlock-unlock \
-  pt-cond-brdcast \
   pt-cond-signal \
   pt-cond-wait \
   pt-cond-timedwait \
@@ -194,6 +193,7 @@ routines := \
   pt-attr-setstackaddr \
   pt-attr-setstacksize \
   pt-cond \
+  pt-cond-brdcast \
   pt-cond-destroy \
   pt-cond-init \
   pt-condattr-destroy \
index 30f7d03aeb0fb2667687610a7afd649a6d7cd96b..6348800117ec3c2a52e0b91388a323b029293a21 100644 (file)
@@ -26,6 +26,7 @@ libc {
     pthread_attr_setscope;
     pthread_attr_setschedparam;
     pthread_attr_init;
+    pthread_cond_broadcast;
     pthread_cond_destroy;
     pthread_cond_init;
     pthread_condattr_getclock;
@@ -96,6 +97,7 @@ libc {
     __pthread_attr_setstacksize;
     __pthread_attr_setstackaddr;
     __pthread_attr_setstack;
+    __pthread_cond_broadcast;
     __pthread_cond_destroy;
     __pthread_cond_init;
     __pthread_condattr_init;
@@ -138,7 +140,6 @@ libpthread {
 
     pthread_cancel;
 
-    pthread_cond_broadcast;
     pthread_cond_signal; pthread_cond_timedwait; pthread_cond_wait;
 
     pthread_create; pthread_detach; pthread_exit;
index 7731b84d049073d15bd410109ef630f8eb829fc1..6c83a2e76c0cbca807927865414bc0def289ae97 100644 (file)
@@ -53,7 +53,6 @@ name decl                                                                   \
 #define FORWARD(name, decl, params, defretval) \
   FORWARD2 (name, int, decl, params, return defretval)
 
-FORWARD (pthread_cond_broadcast, (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)
index 1b147b947a0f0b630f2b8b9bc529f22403ba0764..c0929a14988de24106b6a2a5fc854596b1303ae7 100644 (file)
@@ -27,7 +27,6 @@
 
 #if IS_IN (libpthread)
 static const struct pthread_functions pthread_functions = {
-  .ptr_pthread_cond_broadcast = __pthread_cond_broadcast,
   .ptr_pthread_cond_signal = __pthread_cond_signal,
   .ptr_pthread_cond_wait = __pthread_cond_wait,
   .ptr_pthread_cond_timedwait = __pthread_cond_timedwait,
index a0071740dfdbeba54b3bd7d9448b7f294a9d7b99..baa4fc5eec1b3c8b7dbe48cfeb96a791de89f3e7 100644 (file)
@@ -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
index 99510615ddd9cd90f5762bef24f0e00cff96930c..c09a39823e58e4ab876abfdec95a440adaef3a7a 100644 (file)
@@ -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 *,
index 6d469b7eff5d105f01d70875374150ebcfc011e6..4138abdd3731d640f9db2d53dea374f7cdfa69a9 100644 (file)
@@ -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,
index 7e2a56139e294abb47fd7143aacc870b8c942acc..1244ce868ac664e5cb6a3792e5d72f99193ffb48 100644 (file)
@@ -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);
 }
 
 
index e251d09f5d18acc38253898288a22777cdbdbb63..35ae6bb27f24cf58d640e3044cad0d205daa8f30 100644 (file)
@@ -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_broadcast F
 GLIBC_2.12 pthread_cond_destroy F
 GLIBC_2.12 pthread_cond_init F
 GLIBC_2.12 pthread_condattr_destroy F
index b9d13b27eb7eae3fac7762e3614417b7c029b519..fd35a94f02016db3d3ba599cff481e0d41aac2ca 100644 (file)
@@ -30,7 +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_broadcast F
 GLIBC_2.12 pthread_cond_signal F
 GLIBC_2.12 pthread_cond_timedwait F
 GLIBC_2.12 pthread_cond_wait F
index 154689e8590dc7cab93c53a78bb5cc387af39a9b..1bc76cf8e8e1f6e643368a1cbbac97e5090988b5 100644 (file)
@@ -48,7 +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_broadcast F
 GLIBC_2.38 pthread_cond_clockwait F
 GLIBC_2.38 pthread_cond_signal F
 GLIBC_2.38 pthread_cond_timedwait F