From patchwork Sat Aug 16 00:13:48 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Samuel Thibault X-Patchwork-Id: 118441 Return-Path: X-Original-To: patchwork@sourceware.org Delivered-To: patchwork@sourceware.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 512D03858C62 for ; Sat, 16 Aug 2025 00:19:01 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 512D03858C62 X-Original-To: libc-alpha@sourceware.org Delivered-To: libc-alpha@sourceware.org Received: from sonata.ens-lyon.org (domu-toccata.ens-lyon.fr [140.77.166.138]) by sourceware.org (Postfix) with ESMTPS id A389F3858CB6 for ; Sat, 16 Aug 2025 00:14:08 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org A389F3858CB6 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=ens-lyon.org Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=bounce.ens-lyon.org ARC-Filter: OpenARC Filter v1.0.0 sourceware.org A389F3858CB6 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=140.77.166.138 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1755303248; cv=none; b=KjLBrAGDbyqGzPOZ3YtgDZnhwi2vmGIMH8/q+Aj42iLnyvkWn1dThS0qsDjARD6RZLBwLrcIjXoNyF0EsKql85UFbIJKrLqpP857GZOCaVdK/KNeS/ElANfH2VcCCVU1ZDOqZZWswfvTG4iYEnVHpkKwYtK28Gm0Iq36uhYtJEk= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1755303248; c=relaxed/simple; bh=VOppacQwQ9fl2FHaaDPnmlCGBVKcTFzyZYoK7OvLAXw=; h=From:To:Subject:Date:Message-ID:MIME-Version; b=xAeq1qCMvTt8weeVjjzcOPiRU6DYR1GcXosk101yT7+sk7k5T3q9eF7CE22jNpmj8/BX3M4LNBttn9QleI8OCOCaFFk1tR9FDNLjz1opm9ZuzXUCdUjsWYkE/chJxOJTns+ArfOFPLEkCNBZPXj39oyJquMNhl01xlJhZb/5BYw= ARC-Authentication-Results: i=1; server2.sourceware.org DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org A389F3858CB6 Received: from localhost (localhost [127.0.0.1]) by sonata.ens-lyon.org (Postfix) with ESMTP id 80277A5DF7; Sat, 16 Aug 2025 02:14:07 +0200 (CEST) Received: from sonata.ens-lyon.org ([127.0.0.1]) by localhost (sonata.ens-lyon.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id C-6Iz25bMfZL; Sat, 16 Aug 2025 02:14:07 +0200 (CEST) Received: from begin (165.21.205.77.rev.sfr.net [77.205.21.165]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (P-256) server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by sonata.ens-lyon.org (Postfix) with ESMTPSA id 2674DA49A4; Sat, 16 Aug 2025 02:14:07 +0200 (CEST) Received: from samy by begin with local (Exim 4.98.2) (envelope-from ) id 1un4Yf-00000000Ww1-3zT7; Sat, 16 Aug 2025 02:14:05 +0200 From: Samuel Thibault To: libc-alpha@sourceware.org Cc: gfleury , commit-hurd@gnu.org Subject: [hurd, commited 02/19] htl: move pthread_get/setconcurrency into libc. Date: Sat, 16 Aug 2025 02:13:48 +0200 Message-ID: <20250816001405.126154-3-samuel.thibault@ens-lyon.org> X-Mailer: git-send-email 2.47.2 In-Reply-To: <20250816001405.126154-1-samuel.thibault@ens-lyon.org> References: <20250816001405.126154-1-samuel.thibault@ens-lyon.org> MIME-Version: 1.0 X-Spam-Status: No, score=-12.4 required=5.0 tests=BAYES_00, GIT_PATCH_0, JMQ_SPF_NEUTRAL, KAM_DMARC_STATUS, RCVD_IN_VALIDITY_RPBL_BLOCKED, RCVD_IN_VALIDITY_SAFE_BLOCKED, SPF_HELO_PASS, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org X-BeenThere: libc-alpha@sourceware.org X-Mailman-Version: 2.1.30 Precedence: list List-Id: Libc-alpha mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: libc-alpha-bounces~patchwork=sourceware.org@sourceware.org From: gfleury Message-ID: <20250815181500.107433-3-gfleury@disroot.org> --- htl/Makefile | 4 ++-- htl/Versions | 8 +++++--- sysdeps/htl/pt-getconcurrency.c | 9 ++++++++- sysdeps/htl/pt-setconcurrency.c | 9 ++++++++- sysdeps/htl/pthreadP.h | 4 ++++ 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 -- 9 files changed, 35 insertions(+), 11 deletions(-) diff --git a/htl/Makefile b/htl/Makefile index 0f9e567faa..f33c1dccf2 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 57041917aa..ad3628eb3c 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 d43ef02ffe..c20af5dbeb 100644 --- a/sysdeps/htl/pt-getconcurrency.c +++ b/sysdeps/htl/pt-getconcurrency.c @@ -18,9 +18,16 @@ #include #include +#include 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 7b4b6f7b2d..484e0f8532 100644 --- a/sysdeps/htl/pt-setconcurrency.c +++ b/sysdeps/htl/pt-setconcurrency.c @@ -18,11 +18,12 @@ #include #include +#include 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 384e39d211..5dea8bd172 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 5ba3b7f356..90faf89495 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 23df0ad6d1..58e46f4e7a 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 06a85b5d40..1d87ec1a8d 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 21555b7bd8..b40dda87c2 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