aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorgfleury <gfleury@disroot.org>2025-08-15 20:14:43 +0200
committerSamuel Thibault <samuel.thibault@ens-lyon.org>2025-08-16 01:12:21 +0200
commitb586357e2a6d7245795f9904a90d6651e2f78791 (patch)
tree432775d674cb678b540777fa7f941ff08b25e91a
parentd479e71498412dfcea8bad9aee0ad0ecee86ad65 (diff)
downloadglibc-b586357e2a6d7245795f9904a90d6651e2f78791.zip
glibc-b586357e2a6d7245795f9904a90d6651e2f78791.tar.gz
glibc-b586357e2a6d7245795f9904a90d6651e2f78791.tar.bz2
htl: move pthread_get/setconcurrency into libc.
Message-ID: <20250815181500.107433-3-gfleury@disroot.org>
-rw-r--r--htl/Makefile4
-rw-r--r--htl/Versions8
-rw-r--r--sysdeps/htl/pt-getconcurrency.c9
-rw-r--r--sysdeps/htl/pt-setconcurrency.c9
-rw-r--r--sysdeps/htl/pthreadP.h4
-rw-r--r--sysdeps/mach/hurd/i386/libc.abilist4
-rw-r--r--sysdeps/mach/hurd/i386/libpthread.abilist2
-rw-r--r--sysdeps/mach/hurd/x86_64/libc.abilist4
-rw-r--r--sysdeps/mach/hurd/x86_64/libpthread.abilist2
9 files changed, 35 insertions, 11 deletions
diff --git a/htl/Makefile b/htl/Makefile
index 0f9e567..f33c1dc 100644
--- a/htl/Makefile
+++ b/htl/Makefile
@@ -45,8 +45,6 @@ libpthread-routines := \
pt-thread-start \
pt-thread-terminate \
pt-startup \
- pt-getconcurrency \
- pt-setconcurrency \
pt-docancel \
pt-sysdep \
pt-setup \
@@ -156,6 +154,7 @@ routines := \
pt-condattr-setclock \
pt-condattr-setpshared \
pt-destroy-specific \
+ pt-getconcurrency \
pt-getschedparam \
pt-getspecific \
pt-key-create \
@@ -202,6 +201,7 @@ routines := \
pt-self pt-equal \
pt-setcancelstate \
pt-setcanceltype \
+ pt-setconcurrency \
pt-setschedparam \
pt-setschedprio \
pt-setspecific \
diff --git a/htl/Versions b/htl/Versions
index 5704191..ad3628e 100644
--- a/htl/Versions
+++ b/htl/Versions
@@ -48,6 +48,7 @@ libc {
pthread_condattr_getpshared;
pthread_condattr_setclock;
pthread_condattr_setpshared;
+ pthread_getconcurrency;
pthread_key_create;
pthread_key_delete;
pthread_mutex_destroy;
@@ -84,6 +85,7 @@ libc {
pthread_rwlockattr_setpshared;
pthread_setcancelstate;
pthread_setcanceltype;
+ pthread_setconcurrency;
pthread_setschedprio;
pthread_setspecific;
pthread_sigmask;
@@ -188,6 +190,8 @@ libc {
}
GLIBC_2.43 {
+ pthread_getconcurrency;
+ pthread_setconcurrency;
pthread_setschedprio;
}
@@ -271,7 +275,7 @@ libpthread {
pthread_getattr_np;
- pthread_getconcurrency; pthread_getcpuclockid;
+ pthread_getcpuclockid;
pthread_join;
@@ -280,8 +284,6 @@ libpthread {
pthread_mutex_transfer_np;
- pthread_setconcurrency;
-
pthread_testcancel;
pthread_yield;
diff --git a/sysdeps/htl/pt-getconcurrency.c b/sysdeps/htl/pt-getconcurrency.c
index d43ef02..c20af5d 100644
--- a/sysdeps/htl/pt-getconcurrency.c
+++ b/sysdeps/htl/pt-getconcurrency.c
@@ -18,9 +18,16 @@
#include <pthread.h>
#include <pt-internal.h>
+#include <shlib-compat.h>
int
-pthread_getconcurrency (void)
+__pthread_getconcurrency (void)
{
return __pthread_concurrency;
}
+libc_hidden_def (__pthread_getconcurrency)
+versioned_symbol (libc, __pthread_getconcurrency, pthread_getconcurrency, GLIBC_2_43);
+
+#if OTHER_SHLIB_COMPAT (libpthread, GLIBC_2_12, GLIBC_2_43)
+compat_symbol (libc, __pthread_getconcurrency, pthread_getconcurrency, GLIBC_2_12);
+#endif
diff --git a/sysdeps/htl/pt-setconcurrency.c b/sysdeps/htl/pt-setconcurrency.c
index 7b4b6f7..484e0f8 100644
--- a/sysdeps/htl/pt-setconcurrency.c
+++ b/sysdeps/htl/pt-setconcurrency.c
@@ -18,11 +18,12 @@
#include <pthread.h>
#include <pt-internal.h>
+#include <shlib-compat.h>
int __pthread_concurrency;
int
-pthread_setconcurrency (int new_level)
+__pthread_setconcurrency (int new_level)
{
if (new_level < 0)
return EINVAL;
@@ -31,3 +32,9 @@ pthread_setconcurrency (int new_level)
return 0;
}
+libc_hidden_def (__pthread_setconcurrency)
+versioned_symbol (libc, __pthread_setconcurrency, pthread_setconcurrency, GLIBC_2_43);
+
+#if OTHER_SHLIB_COMPAT (libpthread, GLIBC_2_12, GLIBC_2_43)
+compat_symbol (libc, __pthread_setconcurrency, pthread_setconcurrency, GLIBC_2_12);
+#endif
diff --git a/sysdeps/htl/pthreadP.h b/sysdeps/htl/pthreadP.h
index 384e39d..5dea8bd 100644
--- a/sysdeps/htl/pthreadP.h
+++ b/sysdeps/htl/pthreadP.h
@@ -213,6 +213,10 @@ libc_hidden_proto (__pthread_attr_getstack)
void __pthread_testcancel (void);
int __pthread_attr_init (pthread_attr_t *attr);
int __pthread_condattr_init (pthread_condattr_t *attr);
+int __pthread_setconcurrency (int __new_level);
+libc_hidden_proto (__pthread_setconcurrency)
+int __pthread_getconcurrency (void);
+libc_hidden_proto (__pthread_getconcurrency)
#define __pthread_raise_internal(__sig) raise (__sig)
diff --git a/sysdeps/mach/hurd/i386/libc.abilist b/sysdeps/mach/hurd/i386/libc.abilist
index 5ba3b7f..90faf89 100644
--- a/sysdeps/mach/hurd/i386/libc.abilist
+++ b/sysdeps/mach/hurd/i386/libc.abilist
@@ -71,6 +71,7 @@ GLIBC_2.12 pthread_condattr_init F
GLIBC_2.12 pthread_condattr_setclock F
GLIBC_2.12 pthread_condattr_setpshared F
GLIBC_2.12 pthread_equal F
+GLIBC_2.12 pthread_getconcurrency F
GLIBC_2.12 pthread_getschedparam F
GLIBC_2.12 pthread_getspecific F
GLIBC_2.12 pthread_key_create F
@@ -110,6 +111,7 @@ GLIBC_2.12 pthread_rwlockattr_setpshared F
GLIBC_2.12 pthread_self F
GLIBC_2.12 pthread_setcancelstate F
GLIBC_2.12 pthread_setcanceltype F
+GLIBC_2.12 pthread_setconcurrency F
GLIBC_2.12 pthread_setschedparam F
GLIBC_2.12 pthread_setschedprio F
GLIBC_2.12 pthread_setspecific F
@@ -2634,6 +2636,8 @@ GLIBC_2.42 uabs F
GLIBC_2.42 uimaxabs F
GLIBC_2.42 ulabs F
GLIBC_2.42 ullabs F
+GLIBC_2.43 pthread_getconcurrency F
+GLIBC_2.43 pthread_setconcurrency F
GLIBC_2.43 pthread_setschedprio F
GLIBC_2.5 __readlinkat_chk F
GLIBC_2.5 inet6_opt_append F
diff --git a/sysdeps/mach/hurd/i386/libpthread.abilist b/sysdeps/mach/hurd/i386/libpthread.abilist
index 23df0ad..58e46f4 100644
--- a/sysdeps/mach/hurd/i386/libpthread.abilist
+++ b/sysdeps/mach/hurd/i386/libpthread.abilist
@@ -25,12 +25,10 @@ GLIBC_2.12 pthread_create F
GLIBC_2.12 pthread_detach F
GLIBC_2.12 pthread_exit F
GLIBC_2.12 pthread_getattr_np F
-GLIBC_2.12 pthread_getconcurrency F
GLIBC_2.12 pthread_getcpuclockid F
GLIBC_2.12 pthread_join F
GLIBC_2.12 pthread_kill F
GLIBC_2.12 pthread_mutex_transfer_np F
-GLIBC_2.12 pthread_setconcurrency F
GLIBC_2.12 pthread_spin_destroy F
GLIBC_2.12 pthread_spin_init F
GLIBC_2.12 pthread_spin_lock F
diff --git a/sysdeps/mach/hurd/x86_64/libc.abilist b/sysdeps/mach/hurd/x86_64/libc.abilist
index 06a85b5..1d87ec1 100644
--- a/sysdeps/mach/hurd/x86_64/libc.abilist
+++ b/sysdeps/mach/hurd/x86_64/libc.abilist
@@ -1554,6 +1554,7 @@ GLIBC_2.38 pthread_condattr_setclock F
GLIBC_2.38 pthread_condattr_setpshared F
GLIBC_2.38 pthread_equal F
GLIBC_2.38 pthread_exit F
+GLIBC_2.38 pthread_getconcurrency F
GLIBC_2.38 pthread_getschedparam F
GLIBC_2.38 pthread_getspecific F
GLIBC_2.38 pthread_key_create F
@@ -1602,6 +1603,7 @@ GLIBC_2.38 pthread_rwlockattr_setpshared F
GLIBC_2.38 pthread_self F
GLIBC_2.38 pthread_setcancelstate F
GLIBC_2.38 pthread_setcanceltype F
+GLIBC_2.38 pthread_setconcurrency F
GLIBC_2.38 pthread_setschedparam F
GLIBC_2.38 pthread_setschedprio F
GLIBC_2.38 pthread_setspecific F
@@ -2316,6 +2318,8 @@ GLIBC_2.42 uabs F
GLIBC_2.42 uimaxabs F
GLIBC_2.42 ulabs F
GLIBC_2.42 ullabs F
+GLIBC_2.43 pthread_getconcurrency F
+GLIBC_2.43 pthread_setconcurrency F
GLIBC_2.43 pthread_setschedprio F
HURD_CTHREADS_0.3 __cthread_getspecific F
HURD_CTHREADS_0.3 __cthread_keycreate F
diff --git a/sysdeps/mach/hurd/x86_64/libpthread.abilist b/sysdeps/mach/hurd/x86_64/libpthread.abilist
index 21555b7..b40dda8 100644
--- a/sysdeps/mach/hurd/x86_64/libpthread.abilist
+++ b/sysdeps/mach/hurd/x86_64/libpthread.abilist
@@ -43,14 +43,12 @@ GLIBC_2.38 pthread_create F
GLIBC_2.38 pthread_detach F
GLIBC_2.38 pthread_exit F
GLIBC_2.38 pthread_getattr_np F
-GLIBC_2.38 pthread_getconcurrency F
GLIBC_2.38 pthread_getcpuclockid F
GLIBC_2.38 pthread_hurd_cond_timedwait_np F
GLIBC_2.38 pthread_hurd_cond_wait_np F
GLIBC_2.38 pthread_join F
GLIBC_2.38 pthread_kill F
GLIBC_2.38 pthread_mutex_transfer_np F
-GLIBC_2.38 pthread_setconcurrency F
GLIBC_2.38 pthread_spin_destroy F
GLIBC_2.38 pthread_spin_init F
GLIBC_2.38 pthread_spin_lock F