[PATCH 5/6] htl: move pthread_mutex_consistent, pthread_mutex_consistent_np into libc.

gfleury gfleury@disroot.org
Fri Jan 3 10:37:49 GMT 2025


---
 htl/Makefile                                |  2 +-
 htl/Versions                                |  4 ++--
 sysdeps/htl/pthreadP.h                      |  2 ++
 sysdeps/mach/hurd/htl/pt-mutex-consistent.c | 15 +++++++++++----
 sysdeps/mach/hurd/i386/libc.abilist         |  4 ++++
 sysdeps/mach/hurd/i386/libpthread.abilist   |  2 --
 sysdeps/mach/hurd/x86_64/libc.abilist       |  4 ++++
 sysdeps/mach/hurd/x86_64/libpthread.abilist |  2 --
 8 files changed, 24 insertions(+), 11 deletions(-)

diff --git a/htl/Makefile b/htl/Makefile
index 00aa8c1c..5c81e05c 100644
--- a/htl/Makefile
+++ b/htl/Makefile
@@ -55,7 +55,6 @@ libpthread-routines := \
   pt-testcancel \
   pt-cancel \
   pt-mutex-transfer-np \
-  pt-mutex-consistent \
   pt-rwlock-attr \
   pt-rwlockattr-init \
   pt-rwlockattr-destroy \
@@ -180,6 +179,7 @@ routines := \
   pt-condattr-setclock \
   pt-condattr-setpshared \
   pt-getschedparam \
+  pt-mutex-consistent \
   pt-mutex-destroy \
   pt-mutex-checklocked \
   pt-mutex-getprioceiling \
diff --git a/htl/Versions b/htl/Versions
index 7ddd655d..415faf15 100644
--- a/htl/Versions
+++ b/htl/Versions
@@ -89,6 +89,8 @@ libc {
 
     pthread_mutex_clocklock;
 
+    pthread_mutex_consistent; pthread_mutex_consistent_np;
+
     pthread_mutexattr_getrobust; pthread_mutexattr_getrobust_np;
     pthread_mutexattr_setrobust; pthread_mutexattr_setrobust_np;
   }
@@ -254,8 +256,6 @@ libpthread {
     cnd_broadcast; cnd_destroy; cnd_init; cnd_signal; cnd_timedwait; cnd_wait;
     tss_create; tss_delete; tss_get; tss_set;
 
-    pthread_mutex_consistent; pthread_mutex_consistent_np;
-
     pthread_rwlock_clockrdlock; pthread_rwlock_clockwrlock;
 
     pthread_tryjoin_np; pthread_timedjoin_np; pthread_clockjoin_np;
diff --git a/sysdeps/htl/pthreadP.h b/sysdeps/htl/pthreadP.h
index a3fa624b..239caf36 100644
--- a/sysdeps/htl/pthreadP.h
+++ b/sysdeps/htl/pthreadP.h
@@ -36,6 +36,8 @@ libc_hidden_proto (__pthread_mutex_init)
 extern int __pthread_mutex_clocklock (pthread_mutex_t *__mutex, clockid_t __clockid,
 				    const struct timespec *__abstime);
 libc_hidden_proto (__pthread_mutex_clocklock)
+extern int __pthread_mutex_consistent (pthread_mutex_t *__mtxp);
+libc_hidden_proto (__pthread_mutex_consistent)
 extern int __pthread_mutex_lock (pthread_mutex_t *__mutex);
 libc_hidden_proto (__pthread_mutex_lock)
 extern int __pthread_mutex_getprioceiling (const pthread_mutex_t *__mutex,
diff --git a/sysdeps/mach/hurd/htl/pt-mutex-consistent.c b/sysdeps/mach/hurd/htl/pt-mutex-consistent.c
index ab9edd8a..d3baee6d 100644
--- a/sysdeps/mach/hurd/htl/pt-mutex-consistent.c
+++ b/sysdeps/mach/hurd/htl/pt-mutex-consistent.c
@@ -16,16 +16,17 @@
    License along with the GNU C Library;  if not, see
    <https://www.gnu.org/licenses/>.  */
 
-#include <pthread.h>
+#include <pthreadP.h>
 #include <stdlib.h>
 #include <assert.h>
 #include <pt-internal.h>
 #include "pt-mutex.h"
 #include <hurdlock.h>
 #include <unistd.h>
+#include <shlib-compat.h>
 
 int
-pthread_mutex_consistent (pthread_mutex_t *mtxp)
+__pthread_mutex_consistent (pthread_mutex_t *mtxp)
 {
   int ret = EINVAL;
   unsigned int val = mtxp->__lock;
@@ -44,5 +45,11 @@ pthread_mutex_consistent (pthread_mutex_t *mtxp)
 
   return ret;
 }
-
-weak_alias (pthread_mutex_consistent, pthread_mutex_consistent_np)
+libc_hidden_def (__pthread_mutex_consistent)
+versioned_symbol (libc, __pthread_mutex_consistent, pthread_mutex_consistent, GLIBC_2_41);
+versioned_symbol (libc, __pthread_mutex_consistent, pthread_mutex_consistent_np, GLIBC_2_41);
+
+#if OTHER_SHLIB_COMPAT (libpthread, GLIBC_2_32, GLIBC_2_41)
+compat_symbol (libpthread, __pthread_mutex_consistent,pthread_mutex_consistent, GLIBC_2_32);
+compat_symbol (libpthread, __pthread_mutex_consistent,pthread_mutex_consistent_np, GLIBC_2_32);
+#endif
diff --git a/sysdeps/mach/hurd/i386/libc.abilist b/sysdeps/mach/hurd/i386/libc.abilist
index fb1a17c6..5916f47c 100644
--- a/sysdeps/mach/hurd/i386/libc.abilist
+++ b/sysdeps/mach/hurd/i386/libc.abilist
@@ -2272,6 +2272,8 @@ GLIBC_2.32 mach_print F
 GLIBC_2.32 mremap 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
 GLIBC_2.32 pthread_mutexattr_getrobust F
 GLIBC_2.32 pthread_mutexattr_getrobust_np F
 GLIBC_2.32 pthread_mutexattr_setrobust F
@@ -2544,6 +2546,8 @@ GLIBC_2.41 pthread_condattr_getclock F
 GLIBC_2.41 pthread_condattr_getpshared F
 GLIBC_2.41 pthread_condattr_setclock F
 GLIBC_2.41 pthread_condattr_setpshared F
+GLIBC_2.41 pthread_mutex_consistent F
+GLIBC_2.41 pthread_mutex_consistent_np F
 GLIBC_2.41 pthread_mutex_getprioceiling F
 GLIBC_2.41 pthread_mutex_setprioceiling F
 GLIBC_2.41 pthread_mutexattr_getprioceiling F
diff --git a/sysdeps/mach/hurd/i386/libpthread.abilist b/sysdeps/mach/hurd/i386/libpthread.abilist
index 53b433c7..0877c0a8 100644
--- a/sysdeps/mach/hurd/i386/libpthread.abilist
+++ b/sysdeps/mach/hurd/i386/libpthread.abilist
@@ -99,8 +99,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_mutex_consistent F
-GLIBC_2.32 pthread_mutex_consistent_np F
 GLIBC_2.32 pthread_rwlock_clockrdlock F
 GLIBC_2.32 pthread_rwlock_clockwrlock F
 GLIBC_2.32 pthread_timedjoin_np F
diff --git a/sysdeps/mach/hurd/x86_64/libc.abilist b/sysdeps/mach/hurd/x86_64/libc.abilist
index 027c594c..d466e412 100644
--- a/sysdeps/mach/hurd/x86_64/libc.abilist
+++ b/sysdeps/mach/hurd/x86_64/libc.abilist
@@ -1548,6 +1548,8 @@ GLIBC_2.38 pthread_equal F
 GLIBC_2.38 pthread_exit F
 GLIBC_2.38 pthread_getschedparam F
 GLIBC_2.38 pthread_mutex_clocklock F
+GLIBC_2.38 pthread_mutex_consistent F
+GLIBC_2.38 pthread_mutex_consistent_np F
 GLIBC_2.38 pthread_mutex_destroy F
 GLIBC_2.38 pthread_mutex_getprioceiling F
 GLIBC_2.38 pthread_mutex_init F
@@ -2229,6 +2231,8 @@ GLIBC_2.41 pthread_condattr_getclock F
 GLIBC_2.41 pthread_condattr_getpshared F
 GLIBC_2.41 pthread_condattr_setclock F
 GLIBC_2.41 pthread_condattr_setpshared F
+GLIBC_2.41 pthread_mutex_consistent F
+GLIBC_2.41 pthread_mutex_consistent_np F
 GLIBC_2.41 pthread_mutex_getprioceiling F
 GLIBC_2.41 pthread_mutex_setprioceiling F
 GLIBC_2.41 pthread_mutexattr_getprioceiling F
diff --git a/sysdeps/mach/hurd/x86_64/libpthread.abilist b/sysdeps/mach/hurd/x86_64/libpthread.abilist
index 5f0f73d1..f4cee895 100644
--- a/sysdeps/mach/hurd/x86_64/libpthread.abilist
+++ b/sysdeps/mach/hurd/x86_64/libpthread.abilist
@@ -61,8 +61,6 @@ GLIBC_2.38 pthread_join F
 GLIBC_2.38 pthread_key_create F
 GLIBC_2.38 pthread_key_delete F
 GLIBC_2.38 pthread_kill F
-GLIBC_2.38 pthread_mutex_consistent F
-GLIBC_2.38 pthread_mutex_consistent_np F
 GLIBC_2.38 pthread_mutex_transfer_np F
 GLIBC_2.38 pthread_once F
 GLIBC_2.38 pthread_rwlock_clockrdlock F
-- 
2.39.5



More information about the Libc-alpha mailing list