From patchwork Wed Jan 29 01:33:36 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Samuel Thibault X-Patchwork-Id: 105584 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 A4DDB3857B9B for ; Wed, 29 Jan 2025 01:37:08 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org A4DDB3857B9B X-Original-To: libc-alpha@sourceware.org Delivered-To: libc-alpha@sourceware.org Received: from sonata.ens-lyon.org (sonata.ens-lyon.org [140.77.166.138]) by sourceware.org (Postfix) with ESMTPS id EC8A03857C63 for ; Wed, 29 Jan 2025 01:33:45 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org EC8A03857C63 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 EC8A03857C63 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=1738114426; cv=none; b=dKU0mEaIVtSRiKp3X2qNPVWYGBTPcBL5REODjJhG8o4GqrQxBMbxaHeI2gsTLRWu5239a3VNxtQnee5BeQuvIhFGX0FBddDveUZO3hGgK3ee57PShAXZv3Hg6hDg5PnGB59BXl88HLNqfrkkEqI37+9czDmBp2V2hA5CegEzjQM= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1738114426; c=relaxed/simple; bh=4XstNS/Gdiuwxdq3o6EYTkZM5ecdy7r9jPIFErf0I8E=; h=From:To:Subject:Date:Message-ID:MIME-Version; b=G4HOhPO2gMKGf4p/VKcsMD6wuGR2BKr8y2a2nkpX4moyyT1f/6rzMFFlzB8o+n4P2gMvXPL8id9QiBN2h/+Tr3VNZdUFcqPBzE0DUVBSL5VEr4YVdBTXQf/Hu9ntMLB2HwAFx4PBCJZhRXY3MXf2E2F6+aO0s+DOec7GceGHb90= ARC-Authentication-Results: i=1; server2.sourceware.org DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org EC8A03857C63 Received: from localhost (localhost [127.0.0.1]) by sonata.ens-lyon.org (Postfix) with ESMTP id 61A6DA05F9; Wed, 29 Jan 2025 02:33:44 +0100 (CET) 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 XnV4m1LWIhzj; Wed, 29 Jan 2025 02:33:44 +0100 (CET) Received: from begin (aamiens-653-1-40-48.w83-192.abo.wanadoo.fr [83.192.199.48]) (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 27323A0628; Wed, 29 Jan 2025 02:33:44 +0100 (CET) Received: from samy by begin with local (Exim 4.98) (envelope-from ) id 1tcwxb-0000000AtTr-2gtJ; Wed, 29 Jan 2025 02:33:43 +0100 From: Samuel Thibault To: libc-alpha@sourceware.org Cc: gfleury , commit-hurd@gnu.org Subject: [hurd, commited 1/7] htl: remove leftover for pthread_mutexattr_settype Date: Wed, 29 Jan 2025 02:33:36 +0100 Message-ID: <20250129013342.2596522-2-samuel.thibault@ens-lyon.org> X-Mailer: git-send-email 2.45.2 In-Reply-To: <20250129013342.2596522-1-samuel.thibault@ens-lyon.org> References: <20250129013342.2596522-1-samuel.thibault@ens-lyon.org> MIME-Version: 1.0 X-Spam-Status: No, score=-13.2 required=5.0 tests=BAYES_00, GIT_PATCH_0, JMQ_SPF_NEUTRAL, KAM_DMARC_STATUS, SPF_HELO_PASS, SPF_PASS, TXREP, T_SCC_BODY_TEXT_LINE 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 from b386295727d35a83aa3d4750e198cbf8040c9a23 --- sysdeps/htl/libc-lockP.h | 5 ----- sysdeps/htl/pthreadP.h | 1 - 2 files changed, 6 deletions(-) diff --git a/sysdeps/htl/libc-lockP.h b/sysdeps/htl/libc-lockP.h index a3a53e8833..30801f935f 100644 --- a/sysdeps/htl/libc-lockP.h +++ b/sysdeps/htl/libc-lockP.h @@ -91,9 +91,6 @@ libc_hidden_proto (__pthread_mutexattr_init) extern int __pthread_mutexattr_destroy (pthread_mutexattr_t *__attr); libc_hidden_proto (__pthread_mutexattr_destroy) -extern int __pthread_mutexattr_settype (pthread_mutexattr_t *__attr, - int __kind); - extern int __pthread_rwlock_init (pthread_rwlock_t *__rwlock, const pthread_rwlockattr_t *__attr); @@ -125,7 +122,6 @@ weak_extern (__pthread_mutex_destroy) weak_extern (__pthread_mutex_lock) weak_extern (__pthread_mutex_trylock) weak_extern (__pthread_mutex_unlock) -weak_extern (__pthread_mutexattr_settype) weak_extern (__pthread_rwlock_init) weak_extern (__pthread_rwlock_destroy) weak_extern (__pthread_rwlock_rdlock) @@ -146,7 +142,6 @@ weak_extern (__pthread_setcancelstate) # pragma weak __pthread_mutex_lock # pragma weak __pthread_mutex_trylock # pragma weak __pthread_mutex_unlock -# pragma weak __pthread_mutexattr_settype # pragma weak __pthread_rwlock_destroy # pragma weak __pthread_rwlock_rdlock # pragma weak __pthread_rwlock_tryrdlock diff --git a/sysdeps/htl/pthreadP.h b/sysdeps/htl/pthreadP.h index 20dd5a1cc5..58bcd93006 100644 --- a/sysdeps/htl/pthreadP.h +++ b/sysdeps/htl/pthreadP.h @@ -38,7 +38,6 @@ extern int __pthread_mutex_trylock (pthread_mutex_t *_mutex); extern int __pthread_mutex_timedlock (pthread_mutex_t *__mutex, const struct timespec *__abstime); extern int __pthread_mutex_unlock (pthread_mutex_t *__mutex); -extern int __pthread_mutexattr_settype (pthread_mutexattr_t *attr, int kind); extern int __pthread_mutexattr_getpshared(const pthread_mutexattr_t *__restrict __attr, int *__restrict __pshared); libc_hidden_proto (__pthread_mutexattr_getpshared) From patchwork Wed Jan 29 01:33:37 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Samuel Thibault X-Patchwork-Id: 105583 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 3D2E13857C58 for ; Wed, 29 Jan 2025 01:36:31 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 3D2E13857C58 X-Original-To: libc-alpha@sourceware.org Delivered-To: libc-alpha@sourceware.org Received: from sonata.ens-lyon.org (sonata.ens-lyon.org [140.77.166.138]) by sourceware.org (Postfix) with ESMTPS id EC58C385829B for ; Wed, 29 Jan 2025 01:33:45 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org EC58C385829B 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 EC58C385829B 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=1738114426; cv=none; b=F3XEvNxVx1Y3+EGY5OZCR9C/G6d5ZZ7ttDU+TaffhskjRosA35XZO/76DAawPCkYJV9pjFL+m3N4TUkfNxx8aRNk8DpWFv4KTl+fpMMi68v/RaoR+3JO5mzUsfSZF/3u/Go/lB1ZM0Be3QxRoIoFIp5H8UrHUsgce7RTWDNjdmQ= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1738114426; c=relaxed/simple; bh=cnJi7Da/c8w7pVu/HTNT6YDWivjrxPwBwVKdmgZCeuk=; h=From:To:Subject:Date:Message-ID:MIME-Version; b=OAH8nKjXZdUiAUDLssP6VKut8MPcHZdtGVVxkWlcscEtxkXmRVN2EjrNRIL+RsqEjnPEq0gLnEvUFvf/XNd713V8wdPiDVy8X1X06ApQ6YsHxVAeS0pPninTxsh8BESROe8xttLUnaAwzY77vbdIToxUSpxY3BelWuCnsBxaSLA= ARC-Authentication-Results: i=1; server2.sourceware.org DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org EC58C385829B Received: from localhost (localhost [127.0.0.1]) by sonata.ens-lyon.org (Postfix) with ESMTP id 591D6A5DA5; Wed, 29 Jan 2025 02:33:44 +0100 (CET) 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 Wy_F94k9I8BD; Wed, 29 Jan 2025 02:33:44 +0100 (CET) Received: from begin (aamiens-653-1-40-48.w83-192.abo.wanadoo.fr [83.192.199.48]) (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 23EAEA05F9; Wed, 29 Jan 2025 02:33:44 +0100 (CET) Received: from samy by begin with local (Exim 4.98) (envelope-from ) id 1tcwxb-0000000AtTu-2oI5; Wed, 29 Jan 2025 02:33:43 +0100 From: Samuel Thibault To: libc-alpha@sourceware.org Cc: gfleury , commit-hurd@gnu.org Subject: [hurd,commited 2/7] htl: move pthread_mutex_init into libc. Date: Wed, 29 Jan 2025 02:33:37 +0100 Message-ID: <20250129013342.2596522-3-samuel.thibault@ens-lyon.org> X-Mailer: git-send-email 2.45.2 In-Reply-To: <20250129013342.2596522-1-samuel.thibault@ens-lyon.org> References: <20250129013342.2596522-1-samuel.thibault@ens-lyon.org> MIME-Version: 1.0 X-Spam-Status: No, score=-13.2 required=5.0 tests=BAYES_00, GIT_PATCH_0, JMQ_SPF_NEUTRAL, KAM_DMARC_STATUS, SPF_HELO_PASS, SPF_PASS, TXREP, T_SCC_BODY_TEXT_LINE 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: <20250103103750.870897-2-gfleury@disroot.org> --- htl/Makefile | 2 +- htl/Versions | 5 +++-- htl/forward.c | 4 ---- htl/pt-initialize.c | 1 - sysdeps/htl/libc-lockP.h | 2 -- sysdeps/htl/pthread-functions.h | 4 ---- sysdeps/htl/pthreadP.h | 2 +- sysdeps/htl/timer_routines.c | 2 +- sysdeps/mach/hurd/htl/pt-mutex-init.c | 8 ++++++-- sysdeps/mach/hurd/i386/libc.abilist | 1 + sysdeps/mach/hurd/i386/libpthread.abilist | 1 - sysdeps/mach/hurd/x86_64/libpthread.abilist | 1 - 12 files changed, 13 insertions(+), 20 deletions(-) diff --git a/htl/Makefile b/htl/Makefile index 551d4c01d3..f381499ff7 100644 --- a/htl/Makefile +++ b/htl/Makefile @@ -54,7 +54,6 @@ libpthread-routines := \ pt-setcanceltype \ pt-testcancel \ pt-cancel \ - pt-mutex-init \ pt-mutex-destroy \ pt-mutex-lock \ pt-mutex-trylock \ @@ -189,6 +188,7 @@ routines := \ pt-condattr-setpshared \ pt-getschedparam \ pt-mutex-checklocked \ + pt-mutex-init \ pt-mutexattr-destroy \ pt-mutexattr-getprioceiling \ pt-mutexattr-getprotocol \ diff --git a/htl/Versions b/htl/Versions index f1393ebe34..caa5653e6c 100644 --- a/htl/Versions +++ b/htl/Versions @@ -38,6 +38,7 @@ libc { pthread_condattr_getpshared; pthread_condattr_setclock; pthread_condattr_setpshared; + pthread_mutex_init; pthread_mutexattr_destroy; pthread_mutexattr_getprioceiling; pthread_mutexattr_getprotocol; @@ -137,6 +138,7 @@ libc { __pthread_condattr_init; __pthread_default_condattr; __pthread_mutex_checklocked; + __pthread_mutex_init; __pthread_mutexattr_destroy; __pthread_mutexattr_init; __pthread_mutexattr_settype; @@ -196,7 +198,7 @@ libpthread { __pthread_kill; pthread_mutex_destroy; pthread_mutex_getprioceiling; - pthread_mutex_init; pthread_mutex_lock; pthread_mutex_setprioceiling; + pthread_mutex_lock; pthread_mutex_setprioceiling; pthread_mutex_timedlock; pthread_mutex_transfer_np; pthread_mutex_trylock; pthread_mutex_unlock; @@ -267,7 +269,6 @@ libpthread { __pthread_getspecific; __pthread_setspecific; __pthread_getattr_np; - __pthread_mutex_init; __pthread_mutex_destroy; __pthread_mutex_timedlock; __pthread_enable_asynccancel; diff --git a/htl/forward.c b/htl/forward.c index 2b699c2572..e78637567f 100644 --- a/htl/forward.c +++ b/htl/forward.c @@ -60,10 +60,6 @@ strong_alias (__pthread_exit, pthread_exit); FORWARD (pthread_mutex_destroy, (pthread_mutex_t *mutex), (mutex), 0) -FORWARD (pthread_mutex_init, - (pthread_mutex_t *mutex, const pthread_mutexattr_t *mutexattr), - (mutex, mutexattr), 0) - FORWARD (pthread_mutex_lock, (pthread_mutex_t *mutex), (mutex), 0) FORWARD (pthread_mutex_unlock, (pthread_mutex_t *mutex), (mutex), 0) diff --git a/htl/pt-initialize.c b/htl/pt-initialize.c index a2332776be..606a085dd0 100644 --- a/htl/pt-initialize.c +++ b/htl/pt-initialize.c @@ -29,7 +29,6 @@ static const struct pthread_functions pthread_functions = { .ptr___pthread_exit = __pthread_exit, .ptr_pthread_mutex_destroy = __pthread_mutex_destroy, - .ptr_pthread_mutex_init = __pthread_mutex_init, .ptr_pthread_mutex_lock = __pthread_mutex_lock, .ptr_pthread_mutex_trylock = __pthread_mutex_trylock, .ptr_pthread_mutex_unlock = __pthread_mutex_unlock, diff --git a/sysdeps/htl/libc-lockP.h b/sysdeps/htl/libc-lockP.h index 30801f935f..6c13382a21 100644 --- a/sysdeps/htl/libc-lockP.h +++ b/sysdeps/htl/libc-lockP.h @@ -117,7 +117,6 @@ extern int __pthread_atfork (void (*__prepare) (void), single-threaded processes. */ #if !defined(__NO_WEAK_PTHREAD_ALIASES) && !IS_IN (libpthread) # ifdef weak_extern -weak_extern (__pthread_mutex_init) weak_extern (__pthread_mutex_destroy) weak_extern (__pthread_mutex_lock) weak_extern (__pthread_mutex_trylock) @@ -137,7 +136,6 @@ weak_extern (__pthread_initialize) weak_extern (__pthread_atfork) weak_extern (__pthread_setcancelstate) # else -# pragma weak __pthread_mutex_init # pragma weak __pthread_mutex_destroy # pragma weak __pthread_mutex_lock # pragma weak __pthread_mutex_trylock diff --git a/sysdeps/htl/pthread-functions.h b/sysdeps/htl/pthread-functions.h index 97f4293367..54b773344d 100644 --- a/sysdeps/htl/pthread-functions.h +++ b/sysdeps/htl/pthread-functions.h @@ -23,8 +23,6 @@ void __pthread_exit (void *) __attribute__ ((__noreturn__)); int _pthread_mutex_destroy (pthread_mutex_t *); -int _pthread_mutex_init (pthread_mutex_t *, - const pthread_mutexattr_t *); int __pthread_mutex_lock (pthread_mutex_t *); int __pthread_mutex_trylock (pthread_mutex_t *); int __pthread_mutex_unlock (pthread_mutex_t *); @@ -50,8 +48,6 @@ struct pthread_functions { void (*ptr___pthread_exit) (void *) __attribute__ ((__noreturn__)); int (*ptr_pthread_mutex_destroy) (pthread_mutex_t *); - int (*ptr_pthread_mutex_init) (pthread_mutex_t *, - const pthread_mutexattr_t *); int (*ptr_pthread_mutex_lock) (pthread_mutex_t *); int (*ptr_pthread_mutex_trylock) (pthread_mutex_t *); int (*ptr_pthread_mutex_unlock) (pthread_mutex_t *); diff --git a/sysdeps/htl/pthreadP.h b/sysdeps/htl/pthreadP.h index 58bcd93006..bb17391cb3 100644 --- a/sysdeps/htl/pthreadP.h +++ b/sysdeps/htl/pthreadP.h @@ -32,6 +32,7 @@ extern void __pthread_init_static_tls (struct link_map *) attribute_hidden; /* These represent the interface used by glibc itself. */ extern int __pthread_mutex_init (pthread_mutex_t *__mutex, const pthread_mutexattr_t *__attr); +libc_hidden_proto (__pthread_mutex_init) extern int __pthread_mutex_destroy (pthread_mutex_t *__mutex); extern int __pthread_mutex_lock (pthread_mutex_t *__mutex); extern int __pthread_mutex_trylock (pthread_mutex_t *_mutex); @@ -162,7 +163,6 @@ hidden_proto (__pthread_detach) hidden_proto (__pthread_key_create) hidden_proto (__pthread_getspecific) hidden_proto (__pthread_setspecific) -hidden_proto (__pthread_mutex_init) hidden_proto (__pthread_mutex_destroy) hidden_proto (__pthread_mutex_lock) hidden_proto (__pthread_mutex_trylock) diff --git a/sysdeps/htl/timer_routines.c b/sysdeps/htl/timer_routines.c index 2e019182ab..2039e0ba2e 100644 --- a/sysdeps/htl/timer_routines.c +++ b/sysdeps/htl/timer_routines.c @@ -191,7 +191,7 @@ static void reinit_after_fork (void) { init_module (); - pthread_mutex_init (&__timer_mutex, 0); + __pthread_mutex_init (&__timer_mutex, 0); } diff --git a/sysdeps/mach/hurd/htl/pt-mutex-init.c b/sysdeps/mach/hurd/htl/pt-mutex-init.c index aa8b9cec40..6fb5d36196 100644 --- a/sysdeps/mach/hurd/htl/pt-mutex-init.c +++ b/sysdeps/mach/hurd/htl/pt-mutex-init.c @@ -23,6 +23,7 @@ #include #include "pt-mutex.h" #include +#include static const pthread_mutexattr_t dfl_attr = { .__prioceiling = 0, @@ -54,6 +55,9 @@ __pthread_mutex_init (pthread_mutex_t *mtxp, const pthread_mutexattr_t *attrp) return 0; } +libc_hidden_def (__pthread_mutex_init) +versioned_symbol (libc, __pthread_mutex_init, pthread_mutex_init, GLIBC_2_21); -weak_alias (__pthread_mutex_init, pthread_mutex_init) -hidden_def (__pthread_mutex_init) +#if OTHER_SHLIB_COMPAT (libpthread, GLIBC_2_12, GLIBC_2_21) +compat_symbol (libc, __pthread_mutex_init, pthread_mutex_init, GLIBC_2_12); +#endif diff --git a/sysdeps/mach/hurd/i386/libc.abilist b/sysdeps/mach/hurd/i386/libc.abilist index 40f35ee047..e9559bd265 100644 --- a/sysdeps/mach/hurd/i386/libc.abilist +++ b/sysdeps/mach/hurd/i386/libc.abilist @@ -63,6 +63,7 @@ GLIBC_2.12 pthread_condattr_setclock F GLIBC_2.12 pthread_condattr_setpshared F GLIBC_2.12 pthread_equal F GLIBC_2.12 pthread_getschedparam F +GLIBC_2.12 pthread_mutex_init F GLIBC_2.12 pthread_mutexattr_destroy F GLIBC_2.12 pthread_mutexattr_getprioceiling F GLIBC_2.12 pthread_mutexattr_getprotocol F diff --git a/sysdeps/mach/hurd/i386/libpthread.abilist b/sysdeps/mach/hurd/i386/libpthread.abilist index b925871a0b..6b330744bb 100644 --- a/sysdeps/mach/hurd/i386/libpthread.abilist +++ b/sysdeps/mach/hurd/i386/libpthread.abilist @@ -43,7 +43,6 @@ GLIBC_2.12 pthread_key_delete F GLIBC_2.12 pthread_kill F GLIBC_2.12 pthread_mutex_destroy F GLIBC_2.12 pthread_mutex_getprioceiling F -GLIBC_2.12 pthread_mutex_init F GLIBC_2.12 pthread_mutex_lock F GLIBC_2.12 pthread_mutex_setprioceiling F GLIBC_2.12 pthread_mutex_timedlock F diff --git a/sysdeps/mach/hurd/x86_64/libpthread.abilist b/sysdeps/mach/hurd/x86_64/libpthread.abilist index 608901fb00..047d685a78 100644 --- a/sysdeps/mach/hurd/x86_64/libpthread.abilist +++ b/sysdeps/mach/hurd/x86_64/libpthread.abilist @@ -66,7 +66,6 @@ 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 GLIBC_2.38 pthread_mutex_lock F GLIBC_2.38 pthread_mutex_setprioceiling F GLIBC_2.38 pthread_mutex_timedlock F From patchwork Wed Jan 29 01:33:38 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Samuel Thibault X-Patchwork-Id: 105582 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 F23593857BA5 for ; Wed, 29 Jan 2025 01:35:38 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org F23593857BA5 X-Original-To: libc-alpha@sourceware.org Delivered-To: libc-alpha@sourceware.org Received: from sonata.ens-lyon.org (sonata.ens-lyon.org [140.77.166.138]) by sourceware.org (Postfix) with ESMTPS id EBECE3858D3C for ; Wed, 29 Jan 2025 01:33:45 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org EBECE3858D3C 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 EBECE3858D3C 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=1738114426; cv=none; b=X16srPNQmST7+OIW3BMo4M+Jw4W2K19g3XWLYRJ7SY3zb2OMlRXCDiCQq5Eu08m4A6u9sjpcrBGKehB/n3ctj1TWaiS/vY7w7szOkSF6kGmykZLkY8VA2gzALid0R5AkxQjt3DJrqsmtK1FNtxUBB3aLZeTxp+582c506wxz5E8= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1738114426; c=relaxed/simple; bh=8tJtOTokU8UL5HPJre7C7BZkRpRduDZnLYTNp85feTQ=; h=From:To:Subject:Date:Message-ID:MIME-Version; b=Xox0XJqExUeaRhn0R20Rzl6T2SwLdt6u99gDWsMAsyCWxXdMTggFYlJW+LaZOcYGeMCJ5QIfluAIJSYxzVjFXuhPkeL5aFxaeDGVs1UZeR5PiR+13IovxSVL4zvkonaH+UoMAEtunxp+DJOY761gQnP9Gy5JflAFX4ltqDIng64= ARC-Authentication-Results: i=1; server2.sourceware.org DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org EBECE3858D3C Received: from localhost (localhost [127.0.0.1]) by sonata.ens-lyon.org (Postfix) with ESMTP id 9BC7CA19AA; Wed, 29 Jan 2025 02:33:44 +0100 (CET) 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 1xpPMwXnScf3; Wed, 29 Jan 2025 02:33:44 +0100 (CET) Received: from begin (aamiens-653-1-40-48.w83-192.abo.wanadoo.fr [83.192.199.48]) (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 2EAB1A19A2; Wed, 29 Jan 2025 02:33:44 +0100 (CET) Received: from samy by begin with local (Exim 4.98) (envelope-from ) id 1tcwxb-0000000AtTx-2w9i; Wed, 29 Jan 2025 02:33:43 +0100 From: Samuel Thibault To: libc-alpha@sourceware.org Cc: gfleury , commit-hurd@gnu.org Subject: [hurd, commited 3/7] htl: move pthread_mutex_{lock, unlock, trylock, timedlock, clocklock} Date: Wed, 29 Jan 2025 02:33:38 +0100 Message-ID: <20250129013342.2596522-4-samuel.thibault@ens-lyon.org> X-Mailer: git-send-email 2.45.2 In-Reply-To: <20250129013342.2596522-1-samuel.thibault@ens-lyon.org> References: <20250129013342.2596522-1-samuel.thibault@ens-lyon.org> MIME-Version: 1.0 X-Spam-Status: No, score=-13.2 required=5.0 tests=BAYES_00, GIT_PATCH_0, JMQ_SPF_NEUTRAL, KAM_DMARC_STATUS, KAM_SHORT, SPF_HELO_PASS, SPF_PASS, TXREP, T_SCC_BODY_TEXT_LINE 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 I haven't exposed _pthread_mutex_lock, _pthread_mutex_trylock and _pthread_mutex_unlock in GLIBC_PRIVATE since there aren't used in any code in libpthread Message-ID: <20250103103750.870897-3-gfleury@disroot.org> --- htl/Makefile | 8 +++---- htl/Versions | 25 +++++++++++++-------- htl/forward.c | 4 ---- htl/pt-initialize.c | 3 --- hurd/hurdlock.c | 6 +++++ hurd/hurdlock.h | 5 +++++ sysdeps/htl/libc-lockP.h | 6 ----- sysdeps/htl/pthread-functions.h | 6 ----- sysdeps/htl/pthreadP.h | 11 +++++---- sysdeps/htl/timer_routines.c | 12 +++++----- sysdeps/mach/hurd/htl/pt-mutex-lock.c | 11 +++++---- sysdeps/mach/hurd/htl/pt-mutex-timedlock.c | 5 +++-- sysdeps/mach/hurd/htl/pt-mutex-trylock.c | 11 +++++---- sysdeps/mach/hurd/htl/pt-mutex-unlock.c | 11 +++++---- sysdeps/mach/hurd/i386/libc.abilist | 6 +++++ sysdeps/mach/hurd/i386/libpthread.abilist | 5 ----- sysdeps/mach/hurd/x86_64/libc.abilist | 4 ++++ sysdeps/mach/hurd/x86_64/libpthread.abilist | 5 ----- 18 files changed, 78 insertions(+), 66 deletions(-) diff --git a/htl/Makefile b/htl/Makefile index f381499ff7..0d3e78dee5 100644 --- a/htl/Makefile +++ b/htl/Makefile @@ -55,10 +55,6 @@ libpthread-routines := \ pt-testcancel \ pt-cancel \ pt-mutex-destroy \ - pt-mutex-lock \ - pt-mutex-trylock \ - pt-mutex-timedlock \ - pt-mutex-unlock \ pt-mutex-transfer-np \ pt-mutex-getprioceiling \ pt-mutex-setprioceiling \ @@ -189,6 +185,10 @@ routines := \ pt-getschedparam \ pt-mutex-checklocked \ pt-mutex-init \ + pt-mutex-lock \ + pt-mutex-timedlock \ + pt-mutex-trylock \ + pt-mutex-unlock \ pt-mutexattr-destroy \ pt-mutexattr-getprioceiling \ pt-mutexattr-getprotocol \ diff --git a/htl/Versions b/htl/Versions index caa5653e6c..757cefef61 100644 --- a/htl/Versions +++ b/htl/Versions @@ -39,6 +39,10 @@ libc { pthread_condattr_setclock; pthread_condattr_setpshared; pthread_mutex_init; + pthread_mutex_lock; + pthread_mutex_timedlock; + pthread_mutex_trylock; + pthread_mutex_unlock; pthread_mutexattr_destroy; pthread_mutexattr_getprioceiling; pthread_mutexattr_getprotocol; @@ -66,7 +70,7 @@ libc { pthread_equal; pthread_exit; pthread_getschedparam; pthread_setschedparam; pthread_mutex_destroy; pthread_mutex_init; - pthread_mutex_lock; pthread_mutex_trylock; pthread_mutex_unlock; + pthread_mutex_lock; pthread_mutex_unlock; pthread_self; pthread_setcancelstate; pthread_setcanceltype; __pthread_get_cleanup_stack; } @@ -80,6 +84,8 @@ libc { pthread_cond_clockwait; + pthread_mutex_clocklock; + pthread_mutexattr_getrobust; pthread_mutexattr_getrobust_np; pthread_mutexattr_setrobust; pthread_mutexattr_setrobust_np; } @@ -110,6 +116,9 @@ libc { pthread_sigmask; } + GLIBC_2.42 { + pthread_mutex_trylock; + } GLIBC_PRIVATE { __libc_alloca_cutoff; @@ -139,6 +148,10 @@ libc { __pthread_default_condattr; __pthread_mutex_checklocked; __pthread_mutex_init; + __pthread_mutex_lock; + __pthread_mutex_timedlock; + __pthread_mutex_trylock; + __pthread_mutex_unlock; __pthread_mutexattr_destroy; __pthread_mutexattr_init; __pthread_mutexattr_settype; @@ -198,9 +211,8 @@ libpthread { __pthread_kill; pthread_mutex_destroy; pthread_mutex_getprioceiling; - pthread_mutex_lock; pthread_mutex_setprioceiling; - pthread_mutex_timedlock; pthread_mutex_transfer_np; - pthread_mutex_trylock; pthread_mutex_unlock; + pthread_mutex_setprioceiling; + pthread_mutex_transfer_np; pthread_once; @@ -242,7 +254,6 @@ libpthread { tss_create; tss_delete; tss_get; tss_set; pthread_mutex_consistent; pthread_mutex_consistent_np; - pthread_mutex_clocklock; pthread_rwlock_clockrdlock; pthread_rwlock_clockwrlock; @@ -270,12 +281,8 @@ libpthread { __pthread_setspecific; __pthread_getattr_np; __pthread_mutex_destroy; - __pthread_mutex_timedlock; __pthread_enable_asynccancel; __pthread_disable_asynccancel; - - __pthread_mutex_lock; __pthread_mutex_trylock; __pthread_mutex_unlock; - _pthread_mutex_lock; _pthread_mutex_trylock; _pthread_mutex_unlock; _pthread_rwlock_destroy; _pthread_rwlock_init; } } diff --git a/htl/forward.c b/htl/forward.c index e78637567f..b71099b82b 100644 --- a/htl/forward.c +++ b/htl/forward.c @@ -60,10 +60,6 @@ strong_alias (__pthread_exit, pthread_exit); FORWARD (pthread_mutex_destroy, (pthread_mutex_t *mutex), (mutex), 0) -FORWARD (pthread_mutex_lock, (pthread_mutex_t *mutex), (mutex), 0) - -FORWARD (pthread_mutex_unlock, (pthread_mutex_t *mutex), (mutex), 0) - FORWARD (__pthread_setcancelstate, (int state, int *oldstate), (state, oldstate), 0) strong_alias (__pthread_setcancelstate, pthread_setcancelstate); diff --git a/htl/pt-initialize.c b/htl/pt-initialize.c index 606a085dd0..b8f8c95ce3 100644 --- a/htl/pt-initialize.c +++ b/htl/pt-initialize.c @@ -29,9 +29,6 @@ static const struct pthread_functions pthread_functions = { .ptr___pthread_exit = __pthread_exit, .ptr_pthread_mutex_destroy = __pthread_mutex_destroy, - .ptr_pthread_mutex_lock = __pthread_mutex_lock, - .ptr_pthread_mutex_trylock = __pthread_mutex_trylock, - .ptr_pthread_mutex_unlock = __pthread_mutex_unlock, .ptr___pthread_setcancelstate = __pthread_setcancelstate, .ptr_pthread_setcanceltype = __pthread_setcanceltype, .ptr___pthread_get_cleanup_stack = __pthread_get_cleanup_stack, diff --git a/hurd/hurdlock.c b/hurd/hurdlock.c index 374e4d107a..c771662e84 100644 --- a/hurd/hurdlock.c +++ b/hurd/hurdlock.c @@ -99,6 +99,7 @@ __lll_abstimed_lock (void *ptr, return ETIMEDOUT; } } +libc_hidden_def (__lll_abstimed_lock) /* Robust locks. */ @@ -157,6 +158,7 @@ __lll_robust_lock (void *ptr, int flags) } } } +libc_hidden_def (__lll_robust_lock) int __lll_robust_abstimed_lock (void *ptr, @@ -206,6 +208,7 @@ __lll_robust_abstimed_lock (void *ptr, } } } +libc_hidden_def (__lll_robust_abstimed_lock) int __lll_robust_trylock (void *ptr) @@ -225,6 +228,7 @@ __lll_robust_trylock (void *ptr) return EBUSY; } +libc_hidden_def (__lll_robust_trylock) void __lll_robust_unlock (void *ptr, int flags) @@ -241,3 +245,5 @@ __lll_robust_unlock (void *ptr, int flags) break; } } + +libc_hidden_def (__lll_robust_unlock) diff --git a/hurd/hurdlock.h b/hurd/hurdlock.h index c013c5994c..0cfccc562c 100644 --- a/hurd/hurdlock.h +++ b/hurd/hurdlock.h @@ -68,23 +68,27 @@ extern int __lll_abstimed_xwait (void *__ptr, int __lo, int __hi, using clock CLK. */ extern int __lll_abstimed_lock (void *__ptr, const struct timespec *__tsp, int __flags, int __clk); +libc_hidden_proto (__lll_abstimed_lock) /* Acquire the lock at PTR, but return with an error if the process containing the owner thread dies. */ extern int __lll_robust_lock (void *__ptr, int __flags); #define lll_robust_lock(var, flags) \ __lll_robust_lock (&(var), flags) +libc_hidden_proto (__lll_robust_lock) /* Same as '__lll_robust_lock', but only block until TSP elapses, using clock CLK. */ extern int __lll_robust_abstimed_lock (void *__ptr, const struct timespec *__tsp, int __flags, int __clk); +libc_hidden_proto (__lll_robust_abstimed_lock) /* Same as '__lll_robust_lock', but return with an error if the lock cannot be acquired without blocking. */ extern int __lll_robust_trylock (void *__ptr); #define lll_robust_trylock(var) \ __lll_robust_trylock (&(var)) +libc_hidden_proto (__lll_robust_trylock) /* Wake one or more threads waiting on address PTR, setting its value to VAL before doing so. */ @@ -96,6 +100,7 @@ extern int __lll_robust_trylock (void *__ptr); extern void __lll_robust_unlock (void *__ptr, int __flags); #define lll_robust_unlock(var, flags) \ __lll_robust_unlock (&(var), flags) +libc_hidden_proto (__lll_robust_unlock) /* Rearrange threads waiting on address SRC to instead wait on DST, waking one of them if WAIT_ONE is non-zero. */ diff --git a/sysdeps/htl/libc-lockP.h b/sysdeps/htl/libc-lockP.h index 6c13382a21..3d74cd87e9 100644 --- a/sysdeps/htl/libc-lockP.h +++ b/sysdeps/htl/libc-lockP.h @@ -118,9 +118,6 @@ extern int __pthread_atfork (void (*__prepare) (void), #if !defined(__NO_WEAK_PTHREAD_ALIASES) && !IS_IN (libpthread) # ifdef weak_extern weak_extern (__pthread_mutex_destroy) -weak_extern (__pthread_mutex_lock) -weak_extern (__pthread_mutex_trylock) -weak_extern (__pthread_mutex_unlock) weak_extern (__pthread_rwlock_init) weak_extern (__pthread_rwlock_destroy) weak_extern (__pthread_rwlock_rdlock) @@ -137,9 +134,6 @@ weak_extern (__pthread_atfork) weak_extern (__pthread_setcancelstate) # else # pragma weak __pthread_mutex_destroy -# pragma weak __pthread_mutex_lock -# pragma weak __pthread_mutex_trylock -# pragma weak __pthread_mutex_unlock # pragma weak __pthread_rwlock_destroy # pragma weak __pthread_rwlock_rdlock # pragma weak __pthread_rwlock_tryrdlock diff --git a/sysdeps/htl/pthread-functions.h b/sysdeps/htl/pthread-functions.h index 54b773344d..c44c9038f3 100644 --- a/sysdeps/htl/pthread-functions.h +++ b/sysdeps/htl/pthread-functions.h @@ -23,9 +23,6 @@ void __pthread_exit (void *) __attribute__ ((__noreturn__)); int _pthread_mutex_destroy (pthread_mutex_t *); -int __pthread_mutex_lock (pthread_mutex_t *); -int __pthread_mutex_trylock (pthread_mutex_t *); -int __pthread_mutex_unlock (pthread_mutex_t *); int __pthread_setcancelstate (int, int *); int __pthread_setcanceltype (int, int *); struct __pthread_cancelation_handler **__pthread_get_cleanup_stack (void); @@ -48,9 +45,6 @@ struct pthread_functions { void (*ptr___pthread_exit) (void *) __attribute__ ((__noreturn__)); int (*ptr_pthread_mutex_destroy) (pthread_mutex_t *); - int (*ptr_pthread_mutex_lock) (pthread_mutex_t *); - int (*ptr_pthread_mutex_trylock) (pthread_mutex_t *); - int (*ptr_pthread_mutex_unlock) (pthread_mutex_t *); int (*ptr___pthread_setcancelstate) (int, int *); int (*ptr_pthread_setcanceltype) (int, int *); struct __pthread_cancelation_handler **(*ptr___pthread_get_cleanup_stack) (void); diff --git a/sysdeps/htl/pthreadP.h b/sysdeps/htl/pthreadP.h index bb17391cb3..a2a0a932b7 100644 --- a/sysdeps/htl/pthreadP.h +++ b/sysdeps/htl/pthreadP.h @@ -33,12 +33,19 @@ extern void __pthread_init_static_tls (struct link_map *) attribute_hidden; extern int __pthread_mutex_init (pthread_mutex_t *__mutex, const pthread_mutexattr_t *__attr); 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_destroy (pthread_mutex_t *__mutex); extern int __pthread_mutex_lock (pthread_mutex_t *__mutex); +libc_hidden_proto (__pthread_mutex_lock) extern int __pthread_mutex_trylock (pthread_mutex_t *_mutex); +libc_hidden_proto (__pthread_mutex_trylock) extern int __pthread_mutex_timedlock (pthread_mutex_t *__mutex, const struct timespec *__abstime); +libc_hidden_proto (__pthread_mutex_timedlock) extern int __pthread_mutex_unlock (pthread_mutex_t *__mutex); +libc_hidden_proto (__pthread_mutex_unlock) extern int __pthread_mutexattr_getpshared(const pthread_mutexattr_t *__restrict __attr, int *__restrict __pshared); libc_hidden_proto (__pthread_mutexattr_getpshared) @@ -164,10 +171,6 @@ hidden_proto (__pthread_key_create) hidden_proto (__pthread_getspecific) hidden_proto (__pthread_setspecific) hidden_proto (__pthread_mutex_destroy) -hidden_proto (__pthread_mutex_lock) -hidden_proto (__pthread_mutex_trylock) -hidden_proto (__pthread_mutex_unlock) -hidden_proto (__pthread_mutex_timedlock) hidden_proto (__pthread_get_cleanup_stack) #endif diff --git a/sysdeps/htl/timer_routines.c b/sysdeps/htl/timer_routines.c index 2039e0ba2e..d6ee65d69b 100644 --- a/sysdeps/htl/timer_routines.c +++ b/sysdeps/htl/timer_routines.c @@ -265,7 +265,7 @@ thread_cleanup (void *val) /* How did the signal thread get killed? */ assert (thread != &__timer_signal_thread_rclk); - pthread_mutex_lock (&__timer_mutex); + __pthread_mutex_lock (&__timer_mutex); thread->exists = 0; @@ -277,7 +277,7 @@ thread_cleanup (void *val) else (void) __timer_thread_start (thread); - pthread_mutex_unlock (&__timer_mutex); + __pthread_mutex_unlock (&__timer_mutex); /* Unblock potentially blocked timer_delete(). */ __pthread_cond_broadcast (&thread->cond); @@ -291,7 +291,7 @@ thread_expire_timer (struct thread_node *self, struct timer_node *timer) { self->current_timer = timer; /* Lets timer_delete know timer is running. */ - pthread_mutex_unlock (&__timer_mutex); + __pthread_mutex_unlock (&__timer_mutex); switch (__builtin_expect (timer->event.sigev_notify, SIGEV_SIGNAL)) { @@ -334,7 +334,7 @@ thread_expire_timer (struct thread_node *self, struct timer_node *timer) break; } - pthread_mutex_lock (&__timer_mutex); + __pthread_mutex_lock (&__timer_mutex); self->current_timer = 0; @@ -358,7 +358,7 @@ thread_func (void *arg) pthread_cleanup_push (thread_cleanup, self); - pthread_mutex_lock (&__timer_mutex); + __pthread_mutex_lock (&__timer_mutex); while (1) { @@ -550,5 +550,5 @@ __timer_dealloc (struct timer_node *timer) void __timer_mutex_cancel_handler (void *arg) { - pthread_mutex_unlock (arg); + __pthread_mutex_unlock (arg); } diff --git a/sysdeps/mach/hurd/htl/pt-mutex-lock.c b/sysdeps/mach/hurd/htl/pt-mutex-lock.c index e1e40d8db5..7d93ddd660 100644 --- a/sysdeps/mach/hurd/htl/pt-mutex-lock.c +++ b/sysdeps/mach/hurd/htl/pt-mutex-lock.c @@ -16,13 +16,14 @@ License along with the GNU C Library; if not, see . */ -#include +#include #include #include #include #include "pt-mutex.h" #include #include +#include int __pthread_mutex_lock (pthread_mutex_t *mtxp) @@ -76,7 +77,9 @@ __pthread_mutex_lock (pthread_mutex_t *mtxp) return ret; } +libc_hidden_def (__pthread_mutex_lock) +versioned_symbol (libc, __pthread_mutex_lock, pthread_mutex_lock, GLIBC_2_21); -hidden_def (__pthread_mutex_lock) -strong_alias (__pthread_mutex_lock, _pthread_mutex_lock) -weak_alias (__pthread_mutex_lock, pthread_mutex_lock) +#if OTHER_SHLIB_COMPAT (libpthread, GLIBC_2_12, GLIBC_2_21) +compat_symbol (libc, __pthread_mutex_lock, pthread_mutex_lock, GLIBC_2_12); +#endif diff --git a/sysdeps/mach/hurd/htl/pt-mutex-timedlock.c b/sysdeps/mach/hurd/htl/pt-mutex-timedlock.c index 71ce28a319..90fa407e99 100644 --- a/sysdeps/mach/hurd/htl/pt-mutex-timedlock.c +++ b/sysdeps/mach/hurd/htl/pt-mutex-timedlock.c @@ -16,7 +16,7 @@ License along with the GNU C Library; if not, see . */ -#include +#include #include #include #include @@ -79,6 +79,7 @@ __pthread_mutex_clocklock (pthread_mutex_t *mtxp, return ret; } +libc_hidden_def (__pthread_mutex_clocklock) weak_alias (__pthread_mutex_clocklock, pthread_mutex_clocklock) int @@ -87,5 +88,5 @@ __pthread_mutex_timedlock (pthread_mutex_t *mutex, { return __pthread_mutex_clocklock (mutex, CLOCK_REALTIME, tsp); } +libc_hidden_def (__pthread_mutex_timedlock) weak_alias (__pthread_mutex_timedlock, pthread_mutex_timedlock) -hidden_def (__pthread_mutex_timedlock) diff --git a/sysdeps/mach/hurd/htl/pt-mutex-trylock.c b/sysdeps/mach/hurd/htl/pt-mutex-trylock.c index 5435921231..f1b451e803 100644 --- a/sysdeps/mach/hurd/htl/pt-mutex-trylock.c +++ b/sysdeps/mach/hurd/htl/pt-mutex-trylock.c @@ -16,13 +16,14 @@ License along with the GNU C Library; if not, see . */ -#include +#include #include #include #include #include "pt-mutex.h" #include #include +#include int __pthread_mutex_trylock (pthread_mutex_t *mtxp) @@ -80,7 +81,9 @@ __pthread_mutex_trylock (pthread_mutex_t *mtxp) return ret; } +libc_hidden_def (__pthread_mutex_trylock) +versioned_symbol (libc, __pthread_mutex_trylock, pthread_mutex_trylock, GLIBC_2_42); -hidden_def (__pthread_mutex_trylock) -strong_alias (__pthread_mutex_trylock, _pthread_mutex_trylock) -weak_alias (__pthread_mutex_trylock, pthread_mutex_trylock) +#if OTHER_SHLIB_COMPAT (libpthread, GLIBC_2_12, GLIBC_2_42) +compat_symbol (libc, __pthread_mutex_trylock, pthread_mutex_trylock, GLIBC_2_12); +#endif diff --git a/sysdeps/mach/hurd/htl/pt-mutex-unlock.c b/sysdeps/mach/hurd/htl/pt-mutex-unlock.c index b140416163..1732c34136 100644 --- a/sysdeps/mach/hurd/htl/pt-mutex-unlock.c +++ b/sysdeps/mach/hurd/htl/pt-mutex-unlock.c @@ -16,13 +16,14 @@ License along with the GNU C Library; if not, see . */ -#include +#include #include #include #include #include "pt-mutex.h" #include #include +#include int __pthread_mutex_unlock (pthread_mutex_t *mtxp) @@ -87,7 +88,9 @@ __pthread_mutex_unlock (pthread_mutex_t *mtxp) return ret; } +libc_hidden_def (__pthread_mutex_unlock) +versioned_symbol (libc, __pthread_mutex_unlock, pthread_mutex_unlock, GLIBC_2_21); -hidden_def (__pthread_mutex_unlock) -strong_alias (__pthread_mutex_unlock, _pthread_mutex_unlock) -weak_alias (__pthread_mutex_unlock, pthread_mutex_unlock) +#if OTHER_SHLIB_COMPAT (libpthread, GLIBC_2_12, GLIBC_2_21) +compat_symbol (libc, __pthread_mutex_unlock, pthread_mutex_unlock, GLIBC_2_12); +#endif diff --git a/sysdeps/mach/hurd/i386/libc.abilist b/sysdeps/mach/hurd/i386/libc.abilist index e9559bd265..aba93a281b 100644 --- a/sysdeps/mach/hurd/i386/libc.abilist +++ b/sysdeps/mach/hurd/i386/libc.abilist @@ -64,6 +64,10 @@ GLIBC_2.12 pthread_condattr_setpshared F GLIBC_2.12 pthread_equal F GLIBC_2.12 pthread_getschedparam F GLIBC_2.12 pthread_mutex_init F +GLIBC_2.12 pthread_mutex_lock F +GLIBC_2.12 pthread_mutex_timedlock F +GLIBC_2.12 pthread_mutex_trylock F +GLIBC_2.12 pthread_mutex_unlock F GLIBC_2.12 pthread_mutexattr_destroy F GLIBC_2.12 pthread_mutexattr_getprioceiling F GLIBC_2.12 pthread_mutexattr_getprotocol F @@ -2264,6 +2268,7 @@ 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 pthread_mutex_clocklock F GLIBC_2.32 pthread_mutexattr_getrobust F GLIBC_2.32 pthread_mutexattr_getrobust_np F GLIBC_2.32 pthread_mutexattr_setrobust F @@ -2549,6 +2554,7 @@ GLIBC_2.41 pthread_mutexattr_setrobust F GLIBC_2.41 pthread_mutexattr_setrobust_np F GLIBC_2.41 pthread_mutexattr_settype F GLIBC_2.41 pthread_sigmask F +GLIBC_2.42 pthread_mutex_trylock F GLIBC_2.5 __readlinkat_chk F GLIBC_2.5 inet6_opt_append F GLIBC_2.5 inet6_opt_find F diff --git a/sysdeps/mach/hurd/i386/libpthread.abilist b/sysdeps/mach/hurd/i386/libpthread.abilist index 6b330744bb..8c53b8d0ee 100644 --- a/sysdeps/mach/hurd/i386/libpthread.abilist +++ b/sysdeps/mach/hurd/i386/libpthread.abilist @@ -43,12 +43,8 @@ GLIBC_2.12 pthread_key_delete F GLIBC_2.12 pthread_kill F GLIBC_2.12 pthread_mutex_destroy F GLIBC_2.12 pthread_mutex_getprioceiling F -GLIBC_2.12 pthread_mutex_lock F GLIBC_2.12 pthread_mutex_setprioceiling F -GLIBC_2.12 pthread_mutex_timedlock F GLIBC_2.12 pthread_mutex_transfer_np F -GLIBC_2.12 pthread_mutex_trylock F -GLIBC_2.12 pthread_mutex_unlock F GLIBC_2.12 pthread_once F GLIBC_2.12 pthread_rwlock_destroy F GLIBC_2.12 pthread_rwlock_init F @@ -106,7 +102,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_clocklock F GLIBC_2.32 pthread_mutex_consistent F GLIBC_2.32 pthread_mutex_consistent_np F GLIBC_2.32 pthread_rwlock_clockrdlock F diff --git a/sysdeps/mach/hurd/x86_64/libc.abilist b/sysdeps/mach/hurd/x86_64/libc.abilist index aaf55cbaf4..2251371451 100644 --- a/sysdeps/mach/hurd/x86_64/libc.abilist +++ b/sysdeps/mach/hurd/x86_64/libc.abilist @@ -1547,9 +1547,12 @@ GLIBC_2.38 pthread_condattr_setpshared F 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_destroy F GLIBC_2.38 pthread_mutex_init F GLIBC_2.38 pthread_mutex_lock F +GLIBC_2.38 pthread_mutex_timedlock F +GLIBC_2.38 pthread_mutex_trylock F GLIBC_2.38 pthread_mutex_unlock F GLIBC_2.38 pthread_mutexattr_destroy F GLIBC_2.38 pthread_mutexattr_getprioceiling F @@ -2237,6 +2240,7 @@ GLIBC_2.41 pthread_mutexattr_setrobust F GLIBC_2.41 pthread_mutexattr_setrobust_np F GLIBC_2.41 pthread_mutexattr_settype F GLIBC_2.41 pthread_sigmask F +GLIBC_2.42 pthread_mutex_trylock F HURD_CTHREADS_0.3 __cthread_getspecific F HURD_CTHREADS_0.3 __cthread_keycreate F HURD_CTHREADS_0.3 __cthread_setspecific F diff --git a/sysdeps/mach/hurd/x86_64/libpthread.abilist b/sysdeps/mach/hurd/x86_64/libpthread.abilist index 047d685a78..bd5e12adcc 100644 --- a/sysdeps/mach/hurd/x86_64/libpthread.abilist +++ b/sysdeps/mach/hurd/x86_64/libpthread.abilist @@ -61,17 +61,12 @@ 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_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_lock F GLIBC_2.38 pthread_mutex_setprioceiling F -GLIBC_2.38 pthread_mutex_timedlock F GLIBC_2.38 pthread_mutex_transfer_np F -GLIBC_2.38 pthread_mutex_trylock F -GLIBC_2.38 pthread_mutex_unlock F GLIBC_2.38 pthread_once F GLIBC_2.38 pthread_rwlock_clockrdlock F GLIBC_2.38 pthread_rwlock_clockwrlock F From patchwork Wed Jan 29 01:33:39 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Samuel Thibault X-Patchwork-Id: 105585 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 1FB393857C68 for ; Wed, 29 Jan 2025 01:38:09 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 1FB393857C68 X-Original-To: libc-alpha@sourceware.org Delivered-To: libc-alpha@sourceware.org Received: from sonata.ens-lyon.org (sonata.ens-lyon.org [140.77.166.138]) by sourceware.org (Postfix) with ESMTPS id 0200C3857C68 for ; Wed, 29 Jan 2025 01:33:45 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 0200C3857C68 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 0200C3857C68 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=1738114426; cv=none; b=bbl2uIxK/o5kFxYwfplr1CcjZ7iWtDXutfadqUyNn2QHMcPm/R/HpU5Qvrdgy2q2KiQc3lq+rkNvUXMJV9v8b3r6RI1msWsVWAjP+7SU2G1XvBGRVxlUOH26tK0TJE0E4Pu+/ZM8HY41tLSQQSoIagGo6xXl9iRJb1yw8mAoj9Y= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1738114426; c=relaxed/simple; bh=U69XHQPk5c6iKtzp3IHdfC1SFYrsgUTtOT2XxU55dyA=; h=From:To:Subject:Date:Message-ID:MIME-Version; b=RZh4c1Z5bKWhN1RC/nw8a/NHM4X8H35VuvUy4/JqjMcq2O+Fgt4+PHb/t974hdN1v6sx+2yLSNH+eUOzYrpJhAb8OVN+NLk6wIqYjoV8XbvqEBN4jQtd/2BO3OIJfMPYq2B6+dK2M36oYGcj8jxJ22bHK2BT8PZrYIzgz/2xP2o= ARC-Authentication-Results: i=1; server2.sourceware.org DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 0200C3857C68 Received: from localhost (localhost [127.0.0.1]) by sonata.ens-lyon.org (Postfix) with ESMTP id 87C6AA03E5; Wed, 29 Jan 2025 02:33:44 +0100 (CET) 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 mpWpr3WGYkKr; Wed, 29 Jan 2025 02:33:44 +0100 (CET) Received: from begin (aamiens-653-1-40-48.w83-192.abo.wanadoo.fr [83.192.199.48]) (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 39E6AA19AA; Wed, 29 Jan 2025 02:33:44 +0100 (CET) Received: from samy by begin with local (Exim 4.98) (envelope-from ) id 1tcwxb-0000000AtU0-33nT; Wed, 29 Jan 2025 02:33:43 +0100 From: Samuel Thibault To: libc-alpha@sourceware.org Cc: gfleury , commit-hurd@gnu.org Subject: [hurd, commited 4/7] htl: move pthread_mutex_getprioceiling, pthread_mutex_setprioceiling into libc Date: Wed, 29 Jan 2025 02:33:39 +0100 Message-ID: <20250129013342.2596522-5-samuel.thibault@ens-lyon.org> X-Mailer: git-send-email 2.45.2 In-Reply-To: <20250129013342.2596522-1-samuel.thibault@ens-lyon.org> References: <20250129013342.2596522-1-samuel.thibault@ens-lyon.org> MIME-Version: 1.0 X-Spam-Status: No, score=-13.2 required=5.0 tests=BAYES_00, GIT_PATCH_0, JMQ_SPF_NEUTRAL, KAM_DMARC_STATUS, KAM_SHORT, SPF_HELO_PASS, SPF_PASS, TXREP, T_SCC_BODY_TEXT_LINE 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: <20250103103750.870897-4-gfleury@disroot.org> --- htl/Makefile | 4 ++-- htl/Versions | 7 +++++-- sysdeps/htl/pthreadP.h | 6 ++++++ sysdeps/mach/hurd/htl/pt-mutex-getprioceiling.c | 10 ++++++++-- sysdeps/mach/hurd/htl/pt-mutex-setprioceiling.c | 10 ++++++++-- 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, 37 insertions(+), 12 deletions(-) diff --git a/htl/Makefile b/htl/Makefile index 0d3e78dee5..f7e12983d2 100644 --- a/htl/Makefile +++ b/htl/Makefile @@ -56,8 +56,6 @@ libpthread-routines := \ pt-cancel \ pt-mutex-destroy \ pt-mutex-transfer-np \ - pt-mutex-getprioceiling \ - pt-mutex-setprioceiling \ pt-mutex-consistent \ pt-rwlock-attr \ pt-rwlockattr-init \ @@ -184,8 +182,10 @@ routines := \ pt-condattr-setpshared \ pt-getschedparam \ pt-mutex-checklocked \ + pt-mutex-getprioceiling \ pt-mutex-init \ pt-mutex-lock \ + pt-mutex-setprioceiling \ pt-mutex-timedlock \ pt-mutex-trylock \ pt-mutex-unlock \ diff --git a/htl/Versions b/htl/Versions index 757cefef61..9c016bc6cf 100644 --- a/htl/Versions +++ b/htl/Versions @@ -38,8 +38,10 @@ libc { pthread_condattr_getpshared; pthread_condattr_setclock; pthread_condattr_setpshared; + pthread_mutex_getprioceiling; pthread_mutex_init; pthread_mutex_lock; + pthread_mutex_setprioceiling; pthread_mutex_timedlock; pthread_mutex_trylock; pthread_mutex_unlock; @@ -117,6 +119,8 @@ libc { } GLIBC_2.42 { + pthread_mutex_getprioceiling; + pthread_mutex_setprioceiling; pthread_mutex_trylock; } @@ -210,8 +214,7 @@ libpthread { pthread_kill; __pthread_kill; - pthread_mutex_destroy; pthread_mutex_getprioceiling; - pthread_mutex_setprioceiling; + pthread_mutex_destroy; pthread_mutex_transfer_np; pthread_once; diff --git a/sysdeps/htl/pthreadP.h b/sysdeps/htl/pthreadP.h index a2a0a932b7..e41cb4c85d 100644 --- a/sysdeps/htl/pthreadP.h +++ b/sysdeps/htl/pthreadP.h @@ -39,6 +39,12 @@ libc_hidden_proto (__pthread_mutex_clocklock) extern int __pthread_mutex_destroy (pthread_mutex_t *__mutex); 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, + int *__prioceiling); +libc_hidden_proto (__pthread_mutex_getprioceiling) +extern int __pthread_mutex_setprioceiling (pthread_mutex_t *__mutex, + int __prio, int *__oldprio); +libc_hidden_proto (__pthread_mutex_setprioceiling) extern int __pthread_mutex_trylock (pthread_mutex_t *_mutex); libc_hidden_proto (__pthread_mutex_trylock) extern int __pthread_mutex_timedlock (pthread_mutex_t *__mutex, diff --git a/sysdeps/mach/hurd/htl/pt-mutex-getprioceiling.c b/sysdeps/mach/hurd/htl/pt-mutex-getprioceiling.c index 7a8feadce7..27ea03ee60 100644 --- a/sysdeps/mach/hurd/htl/pt-mutex-getprioceiling.c +++ b/sysdeps/mach/hurd/htl/pt-mutex-getprioceiling.c @@ -16,19 +16,25 @@ License along with the GNU C Library; if not, see . */ -#include +#include #include #include #include #include "pt-mutex.h" #include +#include int -pthread_mutex_getprioceiling (const pthread_mutex_t *mtxp, int *clp) +__pthread_mutex_getprioceiling (const pthread_mutex_t *mtxp, int *clp) { (void) mtxp; (void) clp; return ENOSYS; } +libc_hidden_def (__pthread_mutex_getprioceiling) +versioned_symbol (libc, __pthread_mutex_getprioceiling, pthread_mutex_getprioceiling, GLIBC_2_42); +#if OTHER_SHLIB_COMPAT (libpthread, GLIBC_2_12, GLIBC_2_42) +compat_symbol (libpthread, __pthread_mutex_getprioceiling,pthread_mutex_getprioceiling, GLIBC_2_12); +#endif stub_warning (pthread_mutex_getprioceiling) diff --git a/sysdeps/mach/hurd/htl/pt-mutex-setprioceiling.c b/sysdeps/mach/hurd/htl/pt-mutex-setprioceiling.c index 6ccce83340..5064e2f575 100644 --- a/sysdeps/mach/hurd/htl/pt-mutex-setprioceiling.c +++ b/sysdeps/mach/hurd/htl/pt-mutex-setprioceiling.c @@ -16,20 +16,26 @@ License along with the GNU C Library; if not, see . */ -#include +#include #include #include #include #include "pt-mutex.h" #include +#include int -pthread_mutex_setprioceiling (pthread_mutex_t *mtxp, int cl, int *prp) +__pthread_mutex_setprioceiling (pthread_mutex_t *mtxp, int cl, int *prp) { (void) mtxp; (void) cl; (void) prp; return ENOSYS; } +libc_hidden_def (__pthread_mutex_setprioceiling) +versioned_symbol (libc, __pthread_mutex_setprioceiling, pthread_mutex_setprioceiling, GLIBC_2_42); +#if OTHER_SHLIB_COMPAT (libpthread, GLIBC_2_12, GLIBC_2_42) +compat_symbol (libpthread, __pthread_mutex_setprioceiling,pthread_mutex_setprioceiling, GLIBC_2_12); +#endif stub_warning (pthread_mutex_setprioceiling) diff --git a/sysdeps/mach/hurd/i386/libc.abilist b/sysdeps/mach/hurd/i386/libc.abilist index aba93a281b..c980b46bca 100644 --- a/sysdeps/mach/hurd/i386/libc.abilist +++ b/sysdeps/mach/hurd/i386/libc.abilist @@ -63,8 +63,10 @@ GLIBC_2.12 pthread_condattr_setclock F GLIBC_2.12 pthread_condattr_setpshared F GLIBC_2.12 pthread_equal F GLIBC_2.12 pthread_getschedparam F +GLIBC_2.12 pthread_mutex_getprioceiling F GLIBC_2.12 pthread_mutex_init F GLIBC_2.12 pthread_mutex_lock F +GLIBC_2.12 pthread_mutex_setprioceiling F GLIBC_2.12 pthread_mutex_timedlock F GLIBC_2.12 pthread_mutex_trylock F GLIBC_2.12 pthread_mutex_unlock F @@ -2554,6 +2556,8 @@ GLIBC_2.41 pthread_mutexattr_setrobust F GLIBC_2.41 pthread_mutexattr_setrobust_np F GLIBC_2.41 pthread_mutexattr_settype F GLIBC_2.41 pthread_sigmask F +GLIBC_2.42 pthread_mutex_getprioceiling F +GLIBC_2.42 pthread_mutex_setprioceiling F GLIBC_2.42 pthread_mutex_trylock 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 8c53b8d0ee..0eb452eb02 100644 --- a/sysdeps/mach/hurd/i386/libpthread.abilist +++ b/sysdeps/mach/hurd/i386/libpthread.abilist @@ -42,8 +42,6 @@ GLIBC_2.12 pthread_key_create F GLIBC_2.12 pthread_key_delete F GLIBC_2.12 pthread_kill F GLIBC_2.12 pthread_mutex_destroy F -GLIBC_2.12 pthread_mutex_getprioceiling F -GLIBC_2.12 pthread_mutex_setprioceiling F GLIBC_2.12 pthread_mutex_transfer_np F GLIBC_2.12 pthread_once F GLIBC_2.12 pthread_rwlock_destroy F diff --git a/sysdeps/mach/hurd/x86_64/libc.abilist b/sysdeps/mach/hurd/x86_64/libc.abilist index 2251371451..bdb89fb41d 100644 --- a/sysdeps/mach/hurd/x86_64/libc.abilist +++ b/sysdeps/mach/hurd/x86_64/libc.abilist @@ -1549,8 +1549,10 @@ GLIBC_2.38 pthread_exit F GLIBC_2.38 pthread_getschedparam F GLIBC_2.38 pthread_mutex_clocklock F GLIBC_2.38 pthread_mutex_destroy F +GLIBC_2.38 pthread_mutex_getprioceiling F GLIBC_2.38 pthread_mutex_init F GLIBC_2.38 pthread_mutex_lock F +GLIBC_2.38 pthread_mutex_setprioceiling F GLIBC_2.38 pthread_mutex_timedlock F GLIBC_2.38 pthread_mutex_trylock F GLIBC_2.38 pthread_mutex_unlock F @@ -2240,6 +2242,8 @@ GLIBC_2.41 pthread_mutexattr_setrobust F GLIBC_2.41 pthread_mutexattr_setrobust_np F GLIBC_2.41 pthread_mutexattr_settype F GLIBC_2.41 pthread_sigmask F +GLIBC_2.42 pthread_mutex_getprioceiling F +GLIBC_2.42 pthread_mutex_setprioceiling F GLIBC_2.42 pthread_mutex_trylock 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 bd5e12adcc..faeac21d94 100644 --- a/sysdeps/mach/hurd/x86_64/libpthread.abilist +++ b/sysdeps/mach/hurd/x86_64/libpthread.abilist @@ -64,8 +64,6 @@ 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_destroy F -GLIBC_2.38 pthread_mutex_getprioceiling F -GLIBC_2.38 pthread_mutex_setprioceiling F GLIBC_2.38 pthread_mutex_transfer_np F GLIBC_2.38 pthread_once F GLIBC_2.38 pthread_rwlock_clockrdlock F From patchwork Wed Jan 29 01:33:40 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Samuel Thibault X-Patchwork-Id: 105581 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 304663857B9F for ; Wed, 29 Jan 2025 01:35:22 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 304663857B9F 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 A0DE73857C7F for ; Wed, 29 Jan 2025 01:33:56 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org A0DE73857C7F 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 A0DE73857C7F 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=1738114436; cv=none; b=rk0LJNxkHCBfe2G8jyDyoSPq0Nm/fgRbRFq/+Am7p0ZVIUnAUPgtCKUIv9vnNajMUGUTapUyrzQJzp1OjWejjVyUkmirBFpA9ERfZ2XPGvKrDGAcN52vrDhFN8udMUjPyW4+VeD7yhJv+uauvBBN1ODohVhIHXtqV4LzmtNbS+0= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1738114436; c=relaxed/simple; bh=+K0JB+pq95ZquPOOD/k6ZGnNl/+VKN98hd/FZ9tMPzY=; h=From:To:Subject:Date:Message-ID:MIME-Version; b=Bdsiut5Pvs/Vz6WPKImw12O0xZrb7iBfaDNWz3zWFMW225SxjigCzKFC8Z7dCpWQHQCYkQv+D8T8AiKtFk0yXwUsLQwTclKvzWx17uX/QJ3ZmYZAg7Fc7Vy7daCIv3J94SILHIL9lCOkwCoO9o7VVePGkuYqm+0GvwsklXwkivE= ARC-Authentication-Results: i=1; server2.sourceware.org DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org A0DE73857C7F Received: from localhost (localhost [127.0.0.1]) by sonata.ens-lyon.org (Postfix) with ESMTP id A6F1EA19A2; Wed, 29 Jan 2025 02:33:44 +0100 (CET) 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 w5ptFXXw73Ta; Wed, 29 Jan 2025 02:33:44 +0100 (CET) Received: from begin (aamiens-653-1-40-48.w83-192.abo.wanadoo.fr [83.192.199.48]) (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 3FA99A19BA; Wed, 29 Jan 2025 02:33:44 +0100 (CET) Received: from samy by begin with local (Exim 4.98) (envelope-from ) id 1tcwxb-0000000AtU3-3BMP; Wed, 29 Jan 2025 02:33:43 +0100 From: Samuel Thibault To: libc-alpha@sourceware.org Cc: gfleury , commit-hurd@gnu.org Subject: [hurd,commited 5/7] htl: move pthread_mutex_destroy into libc. Date: Wed, 29 Jan 2025 02:33:40 +0100 Message-ID: <20250129013342.2596522-6-samuel.thibault@ens-lyon.org> X-Mailer: git-send-email 2.45.2 In-Reply-To: <20250129013342.2596522-1-samuel.thibault@ens-lyon.org> References: <20250129013342.2596522-1-samuel.thibault@ens-lyon.org> MIME-Version: 1.0 X-Spam-Status: No, score=-13.1 required=5.0 tests=BAYES_00, GIT_PATCH_0, JMQ_SPF_NEUTRAL, KAM_DMARC_STATUS, SPF_HELO_PASS, SPF_PASS, TXREP, T_SCC_BODY_TEXT_LINE 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: <20250103103750.870897-5-gfleury@disroot.org> --- htl/Makefile | 2 +- htl/Versions | 4 ++-- htl/forward.c | 2 -- htl/pt-initialize.c | 1 - sysdeps/htl/libc-lockP.h | 2 -- sysdeps/htl/pthread-functions.h | 2 -- sysdeps/htl/pthreadP.h | 2 -- sysdeps/mach/hurd/htl/pt-mutex-destroy.c | 8 ++++++-- sysdeps/mach/hurd/i386/libc.abilist | 1 + sysdeps/mach/hurd/i386/libpthread.abilist | 1 - sysdeps/mach/hurd/x86_64/libpthread.abilist | 1 - 11 files changed, 10 insertions(+), 16 deletions(-) diff --git a/htl/Makefile b/htl/Makefile index f7e12983d2..f6abd95772 100644 --- a/htl/Makefile +++ b/htl/Makefile @@ -54,7 +54,6 @@ libpthread-routines := \ pt-setcanceltype \ pt-testcancel \ pt-cancel \ - pt-mutex-destroy \ pt-mutex-transfer-np \ pt-mutex-consistent \ pt-rwlock-attr \ @@ -182,6 +181,7 @@ routines := \ pt-condattr-setpshared \ pt-getschedparam \ pt-mutex-checklocked \ + pt-mutex-destroy \ pt-mutex-getprioceiling \ pt-mutex-init \ pt-mutex-lock \ diff --git a/htl/Versions b/htl/Versions index 9c016bc6cf..9cd9f5a937 100644 --- a/htl/Versions +++ b/htl/Versions @@ -38,6 +38,7 @@ libc { pthread_condattr_getpshared; pthread_condattr_setclock; pthread_condattr_setpshared; + pthread_mutex_destroy; pthread_mutex_getprioceiling; pthread_mutex_init; pthread_mutex_lock; @@ -151,6 +152,7 @@ libc { __pthread_condattr_init; __pthread_default_condattr; __pthread_mutex_checklocked; + __pthread_mutex_destroy; __pthread_mutex_init; __pthread_mutex_lock; __pthread_mutex_timedlock; @@ -214,7 +216,6 @@ libpthread { pthread_kill; __pthread_kill; - pthread_mutex_destroy; pthread_mutex_transfer_np; pthread_once; @@ -283,7 +284,6 @@ libpthread { __pthread_getspecific; __pthread_setspecific; __pthread_getattr_np; - __pthread_mutex_destroy; __pthread_enable_asynccancel; __pthread_disable_asynccancel; _pthread_rwlock_destroy; _pthread_rwlock_init; diff --git a/htl/forward.c b/htl/forward.c index b71099b82b..636902919e 100644 --- a/htl/forward.c +++ b/htl/forward.c @@ -58,8 +58,6 @@ FORWARD_NORETURN (__pthread_exit, void, (void *retval), (retval), exit (EXIT_SUCCESS)) strong_alias (__pthread_exit, pthread_exit); -FORWARD (pthread_mutex_destroy, (pthread_mutex_t *mutex), (mutex), 0) - FORWARD (__pthread_setcancelstate, (int state, int *oldstate), (state, oldstate), 0) strong_alias (__pthread_setcancelstate, pthread_setcancelstate); diff --git a/htl/pt-initialize.c b/htl/pt-initialize.c index b8f8c95ce3..5854bc4967 100644 --- a/htl/pt-initialize.c +++ b/htl/pt-initialize.c @@ -28,7 +28,6 @@ #if IS_IN (libpthread) static const struct pthread_functions pthread_functions = { .ptr___pthread_exit = __pthread_exit, - .ptr_pthread_mutex_destroy = __pthread_mutex_destroy, .ptr___pthread_setcancelstate = __pthread_setcancelstate, .ptr_pthread_setcanceltype = __pthread_setcanceltype, .ptr___pthread_get_cleanup_stack = __pthread_get_cleanup_stack, diff --git a/sysdeps/htl/libc-lockP.h b/sysdeps/htl/libc-lockP.h index 3d74cd87e9..f39c8bba87 100644 --- a/sysdeps/htl/libc-lockP.h +++ b/sysdeps/htl/libc-lockP.h @@ -117,7 +117,6 @@ extern int __pthread_atfork (void (*__prepare) (void), single-threaded processes. */ #if !defined(__NO_WEAK_PTHREAD_ALIASES) && !IS_IN (libpthread) # ifdef weak_extern -weak_extern (__pthread_mutex_destroy) weak_extern (__pthread_rwlock_init) weak_extern (__pthread_rwlock_destroy) weak_extern (__pthread_rwlock_rdlock) @@ -133,7 +132,6 @@ weak_extern (__pthread_initialize) weak_extern (__pthread_atfork) weak_extern (__pthread_setcancelstate) # else -# pragma weak __pthread_mutex_destroy # pragma weak __pthread_rwlock_destroy # pragma weak __pthread_rwlock_rdlock # pragma weak __pthread_rwlock_tryrdlock diff --git a/sysdeps/htl/pthread-functions.h b/sysdeps/htl/pthread-functions.h index c44c9038f3..45f15c2641 100644 --- a/sysdeps/htl/pthread-functions.h +++ b/sysdeps/htl/pthread-functions.h @@ -22,7 +22,6 @@ #include void __pthread_exit (void *) __attribute__ ((__noreturn__)); -int _pthread_mutex_destroy (pthread_mutex_t *); int __pthread_setcancelstate (int, int *); int __pthread_setcanceltype (int, int *); struct __pthread_cancelation_handler **__pthread_get_cleanup_stack (void); @@ -44,7 +43,6 @@ int _cthreads_ftrylockfile (FILE *); struct pthread_functions { void (*ptr___pthread_exit) (void *) __attribute__ ((__noreturn__)); - int (*ptr_pthread_mutex_destroy) (pthread_mutex_t *); int (*ptr___pthread_setcancelstate) (int, int *); int (*ptr_pthread_setcanceltype) (int, int *); struct __pthread_cancelation_handler **(*ptr___pthread_get_cleanup_stack) (void); diff --git a/sysdeps/htl/pthreadP.h b/sysdeps/htl/pthreadP.h index e41cb4c85d..f8aab6af9e 100644 --- a/sysdeps/htl/pthreadP.h +++ b/sysdeps/htl/pthreadP.h @@ -36,7 +36,6 @@ 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_destroy (pthread_mutex_t *__mutex); 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, @@ -176,7 +175,6 @@ hidden_proto (__pthread_detach) hidden_proto (__pthread_key_create) hidden_proto (__pthread_getspecific) hidden_proto (__pthread_setspecific) -hidden_proto (__pthread_mutex_destroy) hidden_proto (__pthread_get_cleanup_stack) #endif diff --git a/sysdeps/mach/hurd/htl/pt-mutex-destroy.c b/sysdeps/mach/hurd/htl/pt-mutex-destroy.c index fdb59623bb..c0624ec72f 100644 --- a/sysdeps/mach/hurd/htl/pt-mutex-destroy.c +++ b/sysdeps/mach/hurd/htl/pt-mutex-destroy.c @@ -22,6 +22,7 @@ #include #include "pt-mutex.h" #include +#include int __pthread_mutex_destroy (pthread_mutex_t *mtxp) @@ -33,6 +34,9 @@ __pthread_mutex_destroy (pthread_mutex_t *mtxp) mtxp->__type = -1; return 0; } +libc_hidden_def (__pthread_mutex_destroy) +versioned_symbol (libc, __pthread_mutex_destroy, pthread_mutex_destroy, GLIBC_2_21); -weak_alias (__pthread_mutex_destroy, pthread_mutex_destroy) -hidden_def (__pthread_mutex_destroy) +#if OTHER_SHLIB_COMPAT (libpthread, GLIBC_2_12, GLIBC_2_21) +compat_symbol (libc, __pthread_mutex_destroy, pthread_mutex_destroy, GLIBC_2_12); +#endif diff --git a/sysdeps/mach/hurd/i386/libc.abilist b/sysdeps/mach/hurd/i386/libc.abilist index c980b46bca..f153f475c3 100644 --- a/sysdeps/mach/hurd/i386/libc.abilist +++ b/sysdeps/mach/hurd/i386/libc.abilist @@ -63,6 +63,7 @@ GLIBC_2.12 pthread_condattr_setclock F GLIBC_2.12 pthread_condattr_setpshared F GLIBC_2.12 pthread_equal F GLIBC_2.12 pthread_getschedparam F +GLIBC_2.12 pthread_mutex_destroy F GLIBC_2.12 pthread_mutex_getprioceiling F GLIBC_2.12 pthread_mutex_init F GLIBC_2.12 pthread_mutex_lock F diff --git a/sysdeps/mach/hurd/i386/libpthread.abilist b/sysdeps/mach/hurd/i386/libpthread.abilist index 0eb452eb02..53b433c725 100644 --- a/sysdeps/mach/hurd/i386/libpthread.abilist +++ b/sysdeps/mach/hurd/i386/libpthread.abilist @@ -41,7 +41,6 @@ GLIBC_2.12 pthread_join F GLIBC_2.12 pthread_key_create F GLIBC_2.12 pthread_key_delete F GLIBC_2.12 pthread_kill F -GLIBC_2.12 pthread_mutex_destroy F GLIBC_2.12 pthread_mutex_transfer_np F GLIBC_2.12 pthread_once F GLIBC_2.12 pthread_rwlock_destroy F diff --git a/sysdeps/mach/hurd/x86_64/libpthread.abilist b/sysdeps/mach/hurd/x86_64/libpthread.abilist index faeac21d94..5f0f73d10f 100644 --- a/sysdeps/mach/hurd/x86_64/libpthread.abilist +++ b/sysdeps/mach/hurd/x86_64/libpthread.abilist @@ -63,7 +63,6 @@ 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_destroy F GLIBC_2.38 pthread_mutex_transfer_np F GLIBC_2.38 pthread_once F GLIBC_2.38 pthread_rwlock_clockrdlock F From patchwork Wed Jan 29 01:33:41 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Samuel Thibault X-Patchwork-Id: 105586 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 7C6093857B91 for ; Wed, 29 Jan 2025 01:38:53 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 7C6093857B91 X-Original-To: libc-alpha@sourceware.org Delivered-To: libc-alpha@sourceware.org Received: from sonata.ens-lyon.org (sonata.ens-lyon.org [140.77.166.138]) by sourceware.org (Postfix) with ESMTPS id 9B8B13857C7B for ; Wed, 29 Jan 2025 01:33:56 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 9B8B13857C7B 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 9B8B13857C7B 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=1738114436; cv=none; b=ah0/1SkKmfDuskiUZGSaf82OICop1yFGwpFUnr3OBU6NCyLzhrzcAynfOaaSW3Yipwozts5F/N3l6jmbnDTZI/CMXfQ1QJngIqywtwxLoKHH9+1FmcPnPdXp59HNwfcVdLv0ulHrYAdDlyCU4+ZMdImOSJRQO6j7AXNZhjThoTg= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1738114436; c=relaxed/simple; bh=94SCdamXi1szJDCw6s3BTolBnjRbsK2cNNJKS+kbD58=; h=From:To:Subject:Date:Message-ID:MIME-Version; b=ff/Nql4ryG5c1qOl/Kso4DFE+OhojGjY0nK4slFpFshCGico1TZFb2ujsA9UKNkQ/vA8NiXBdffV7PGCwgBVWZZQ1vg1jAxg5ETQjYUBNBxTebglgfeb/ozlEjibR73i+WDx3a5CmVYmR9OzUMIPCUtnIVcmS/M0RrigLRfD8dI= ARC-Authentication-Results: i=1; server2.sourceware.org DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 9B8B13857C7B Received: from localhost (localhost [127.0.0.1]) by sonata.ens-lyon.org (Postfix) with ESMTP id BB67EA19BA; Wed, 29 Jan 2025 02:33:44 +0100 (CET) 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 au-LuiJhIbY2; Wed, 29 Jan 2025 02:33:44 +0100 (CET) Received: from begin (aamiens-653-1-40-48.w83-192.abo.wanadoo.fr [83.192.199.48]) (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 48E71A49C6; Wed, 29 Jan 2025 02:33:44 +0100 (CET) Received: from samy by begin with local (Exim 4.98) (envelope-from ) id 1tcwxb-0000000AtU7-3KtJ; Wed, 29 Jan 2025 02:33:43 +0100 From: Samuel Thibault To: libc-alpha@sourceware.org Cc: gfleury , commit-hurd@gnu.org Subject: [hurd, commited 6/7] htl: move pthread_mutex_consistent, pthread_mutex_consistent_np into libc. Date: Wed, 29 Jan 2025 02:33:41 +0100 Message-ID: <20250129013342.2596522-7-samuel.thibault@ens-lyon.org> X-Mailer: git-send-email 2.45.2 In-Reply-To: <20250129013342.2596522-1-samuel.thibault@ens-lyon.org> References: <20250129013342.2596522-1-samuel.thibault@ens-lyon.org> MIME-Version: 1.0 X-Spam-Status: No, score=-13.1 required=5.0 tests=BAYES_00, GIT_PATCH_0, JMQ_SPF_NEUTRAL, KAM_DMARC_STATUS, KAM_SHORT, SPF_HELO_PASS, SPF_PASS, TXREP, T_SCC_BODY_TEXT_LINE 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: <20250103103750.870897-6-gfleury@disroot.org> --- htl/Makefile | 2 +- htl/Versions | 5 +++-- 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, 25 insertions(+), 11 deletions(-) diff --git a/htl/Makefile b/htl/Makefile index f6abd95772..5b0b6023b0 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 \ @@ -181,6 +180,7 @@ routines := \ pt-condattr-setpshared \ pt-getschedparam \ pt-mutex-checklocked \ + pt-mutex-consistent \ pt-mutex-destroy \ pt-mutex-getprioceiling \ pt-mutex-init \ diff --git a/htl/Versions b/htl/Versions index 9cd9f5a937..2ebf554cfa 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; } @@ -120,6 +122,7 @@ libc { } GLIBC_2.42 { + pthread_mutex_consistent; pthread_mutex_consistent_np; pthread_mutex_getprioceiling; pthread_mutex_setprioceiling; pthread_mutex_trylock; @@ -257,8 +260,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 f8aab6af9e..c39c7f117b 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 ab9edd8a1c..5aa75d15bd 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 . */ -#include +#include #include #include #include #include "pt-mutex.h" #include #include +#include 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_42); +versioned_symbol (libc, __pthread_mutex_consistent, pthread_mutex_consistent_np, GLIBC_2_42); + +#if OTHER_SHLIB_COMPAT (libpthread, GLIBC_2_32, GLIBC_2_42) +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 f153f475c3..17656eb119 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 @@ -2557,6 +2559,8 @@ GLIBC_2.41 pthread_mutexattr_setrobust F GLIBC_2.41 pthread_mutexattr_setrobust_np F GLIBC_2.41 pthread_mutexattr_settype F GLIBC_2.41 pthread_sigmask F +GLIBC_2.42 pthread_mutex_consistent F +GLIBC_2.42 pthread_mutex_consistent_np F GLIBC_2.42 pthread_mutex_getprioceiling F GLIBC_2.42 pthread_mutex_setprioceiling F GLIBC_2.42 pthread_mutex_trylock F diff --git a/sysdeps/mach/hurd/i386/libpthread.abilist b/sysdeps/mach/hurd/i386/libpthread.abilist index 53b433c725..0877c0a84b 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 bdb89fb41d..4f7ba3a700 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 @@ -2242,6 +2244,8 @@ GLIBC_2.41 pthread_mutexattr_setrobust F GLIBC_2.41 pthread_mutexattr_setrobust_np F GLIBC_2.41 pthread_mutexattr_settype F GLIBC_2.41 pthread_sigmask F +GLIBC_2.42 pthread_mutex_consistent F +GLIBC_2.42 pthread_mutex_consistent_np F GLIBC_2.42 pthread_mutex_getprioceiling F GLIBC_2.42 pthread_mutex_setprioceiling F GLIBC_2.42 pthread_mutex_trylock F diff --git a/sysdeps/mach/hurd/x86_64/libpthread.abilist b/sysdeps/mach/hurd/x86_64/libpthread.abilist index 5f0f73d10f..f4cee89580 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 From patchwork Wed Jan 29 01:33:42 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Samuel Thibault X-Patchwork-Id: 105587 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 C27673857C47 for ; Wed, 29 Jan 2025 01:40:41 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org C27673857C47 X-Original-To: libc-alpha@sourceware.org Delivered-To: libc-alpha@sourceware.org Received: from sonata.ens-lyon.org (sonata.ens-lyon.org [140.77.166.138]) by sourceware.org (Postfix) with ESMTPS id 0B8593857C6C for ; Wed, 29 Jan 2025 01:33:57 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 0B8593857C6C 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 0B8593857C6C 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=1738114437; cv=none; b=cGCVHPQ3rH+YZ4dCG0nKdyJVv5AkVjiByFDZrJ06oKwinpDVQWwkog41btTxIyERSqPru7c1uJczbi9HeBDhi7kebalf28RVXkbtXXUiTgzQS/P7l+cQypmOIvVy1sALdfV2gsjqf1hGkoV+v1Yim0AKH4/pZJzO1F4Zcw2SP+M= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1738114437; c=relaxed/simple; bh=mYB3H7L/GvgGKFN6dcp1NlAfbjXEzAYvLeO97vV1LVE=; h=From:To:Subject:Date:Message-ID:MIME-Version; b=xODkvAtoG0QMSPz2mPXjwSd4by/00HGaWkm8u27N877HcTrTV7EnNHiFCCDRh/DSbMAHEiAhW42PrPuocJRFBiyHIDpr+xFjA65ZYmOukpp29mQaINUN67s9l7PGDB2/shhmqCV4xfaBU2D0/d+3oGSER3omClK0kAXotM7RXdA= ARC-Authentication-Results: i=1; server2.sourceware.org DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 0B8593857C6C Received: from localhost (localhost [127.0.0.1]) by sonata.ens-lyon.org (Postfix) with ESMTP id C6583A49C6; Wed, 29 Jan 2025 02:33:44 +0100 (CET) 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 5EgmXw78OaNU; Wed, 29 Jan 2025 02:33:44 +0100 (CET) Received: from begin (aamiens-653-1-40-48.w83-192.abo.wanadoo.fr [83.192.199.48]) (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 51398A5DA3; Wed, 29 Jan 2025 02:33:44 +0100 (CET) Received: from samy by begin with local (Exim 4.98) (envelope-from ) id 1tcwxb-0000000AtUB-3U2H; Wed, 29 Jan 2025 02:33:43 +0100 From: Samuel Thibault To: libc-alpha@sourceware.org Cc: gfleury , commit-hurd@gnu.org Subject: [hurd,commited 7/7] htl: move pthread_setcanceltype into libc. Date: Wed, 29 Jan 2025 02:33:42 +0100 Message-ID: <20250129013342.2596522-8-samuel.thibault@ens-lyon.org> X-Mailer: git-send-email 2.45.2 In-Reply-To: <20250129013342.2596522-1-samuel.thibault@ens-lyon.org> References: <20250129013342.2596522-1-samuel.thibault@ens-lyon.org> MIME-Version: 1.0 X-Spam-Status: No, score=-13.1 required=5.0 tests=BAYES_00, GIT_PATCH_0, JMQ_SPF_NEUTRAL, KAM_DMARC_STATUS, KAM_SHORT, SPF_HELO_PASS, SPF_PASS, TXREP, T_SCC_BODY_TEXT_LINE 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: <20250103103750.870897-7-gfleury@disroot.org> --- htl/Makefile | 2 +- htl/Versions | 3 ++- htl/forward.c | 2 -- htl/pt-initialize.c | 1 - htl/pt-setcanceltype.c | 8 ++++++-- sysdeps/htl/pthread-functions.h | 2 -- sysdeps/htl/pthreadP.h | 3 +++ sysdeps/mach/hurd/i386/libc.abilist | 1 + sysdeps/mach/hurd/i386/libpthread.abilist | 1 - sysdeps/mach/hurd/x86_64/libpthread.abilist | 1 - 10 files changed, 13 insertions(+), 11 deletions(-) diff --git a/htl/Makefile b/htl/Makefile index 5b0b6023b0..d4418ab9f9 100644 --- a/htl/Makefile +++ b/htl/Makefile @@ -51,7 +51,6 @@ libpthread-routines := \ pt-spin-inlines \ pt-cleanup \ pt-setcancelstate \ - pt-setcanceltype \ pt-testcancel \ pt-cancel \ pt-mutex-transfer-np \ @@ -204,6 +203,7 @@ routines := \ pt-nthreads \ pt-pthread_self \ pt-self pt-equal \ + pt-setcanceltype \ pt-setschedparam \ pt-sigmask \ pt-sigstate \ diff --git a/htl/Versions b/htl/Versions index 2ebf554cfa..6801d12182 100644 --- a/htl/Versions +++ b/htl/Versions @@ -56,6 +56,7 @@ libc { pthread_mutexattr_setprotocol; pthread_mutexattr_setpshared; pthread_mutexattr_settype; + pthread_setcanceltype; pthread_sigmask; } @@ -231,7 +232,7 @@ libpthread { pthread_rwlockattr_destroy; pthread_rwlockattr_getpshared; pthread_rwlockattr_init; pthread_rwlockattr_setpshared; - pthread_setcancelstate; pthread_setcanceltype; + pthread_setcancelstate; pthread_setconcurrency; pthread_setschedprio; pthread_setspecific; diff --git a/htl/forward.c b/htl/forward.c index 636902919e..9455df7316 100644 --- a/htl/forward.c +++ b/htl/forward.c @@ -62,7 +62,5 @@ FORWARD (__pthread_setcancelstate, (int state, int *oldstate), (state, oldstate), 0) strong_alias (__pthread_setcancelstate, pthread_setcancelstate); -FORWARD (pthread_setcanceltype, (int type, int *oldtype), (type, oldtype), 0) - FORWARD2 (__pthread_get_cleanup_stack, struct __pthread_cancelation_handler **, (void), (), return &__pthread_cleanup_stack); diff --git a/htl/pt-initialize.c b/htl/pt-initialize.c index 5854bc4967..eba9e12d73 100644 --- a/htl/pt-initialize.c +++ b/htl/pt-initialize.c @@ -29,7 +29,6 @@ static const struct pthread_functions pthread_functions = { .ptr___pthread_exit = __pthread_exit, .ptr___pthread_setcancelstate = __pthread_setcancelstate, - .ptr_pthread_setcanceltype = __pthread_setcanceltype, .ptr___pthread_get_cleanup_stack = __pthread_get_cleanup_stack, .ptr_pthread_once = __pthread_once, .ptr_pthread_rwlock_rdlock = __pthread_rwlock_rdlock, diff --git a/htl/pt-setcanceltype.c b/htl/pt-setcanceltype.c index f9474f9c39..0b76fbfbd6 100644 --- a/htl/pt-setcanceltype.c +++ b/htl/pt-setcanceltype.c @@ -17,7 +17,7 @@ . */ #include - +#include #include int @@ -42,5 +42,9 @@ __pthread_setcanceltype (int type, int *oldtype) return 0; } +libc_hidden_def (__pthread_setcanceltype) +versioned_symbol (libc, __pthread_setcanceltype, pthread_setcanceltype, GLIBC_2_21); -weak_alias (__pthread_setcanceltype, pthread_setcanceltype); +#if OTHER_SHLIB_COMPAT (libpthread, GLIBC_2_12, GLIBC_2_21) +compat_symbol (libc, __pthread_setcanceltype, pthread_setcanceltype, GLIBC_2_12); +#endif diff --git a/sysdeps/htl/pthread-functions.h b/sysdeps/htl/pthread-functions.h index 45f15c2641..9788085b83 100644 --- a/sysdeps/htl/pthread-functions.h +++ b/sysdeps/htl/pthread-functions.h @@ -23,7 +23,6 @@ void __pthread_exit (void *) __attribute__ ((__noreturn__)); int __pthread_setcancelstate (int, int *); -int __pthread_setcanceltype (int, int *); struct __pthread_cancelation_handler **__pthread_get_cleanup_stack (void); int __pthread_once (pthread_once_t *, void (*) (void)); int __pthread_rwlock_rdlock (pthread_rwlock_t *); @@ -44,7 +43,6 @@ struct pthread_functions { void (*ptr___pthread_exit) (void *) __attribute__ ((__noreturn__)); int (*ptr___pthread_setcancelstate) (int, int *); - int (*ptr_pthread_setcanceltype) (int, int *); struct __pthread_cancelation_handler **(*ptr___pthread_get_cleanup_stack) (void); int (*ptr_pthread_once) (pthread_once_t *, void (*) (void)); int (*ptr_pthread_rwlock_rdlock) (pthread_rwlock_t *); diff --git a/sysdeps/htl/pthreadP.h b/sysdeps/htl/pthreadP.h index c39c7f117b..889a63200d 100644 --- a/sysdeps/htl/pthreadP.h +++ b/sysdeps/htl/pthreadP.h @@ -118,6 +118,9 @@ extern int __pthread_cond_clockwait (pthread_cond_t *cond, libc_hidden_proto (__pthread_cond_clockwait); extern int __pthread_cond_destroy (pthread_cond_t *cond); libc_hidden_proto (__pthread_cond_destroy); + +extern int __pthread_setcanceltype (int __type, int *__oldtype); +libc_hidden_proto (__pthread_setcanceltype); extern int __pthread_sigmask (int, const sigset_t *, sigset_t *); libc_hidden_proto (__pthread_sigmask); diff --git a/sysdeps/mach/hurd/i386/libc.abilist b/sysdeps/mach/hurd/i386/libc.abilist index 17656eb119..c26eddba3d 100644 --- a/sysdeps/mach/hurd/i386/libc.abilist +++ b/sysdeps/mach/hurd/i386/libc.abilist @@ -82,6 +82,7 @@ GLIBC_2.12 pthread_mutexattr_setprotocol F GLIBC_2.12 pthread_mutexattr_setpshared F GLIBC_2.12 pthread_mutexattr_settype F GLIBC_2.12 pthread_self F +GLIBC_2.12 pthread_setcanceltype F GLIBC_2.12 pthread_setschedparam F GLIBC_2.12 pthread_sigmask F GLIBC_2.13 __fentry__ F diff --git a/sysdeps/mach/hurd/i386/libpthread.abilist b/sysdeps/mach/hurd/i386/libpthread.abilist index 0877c0a84b..30b598ffd9 100644 --- a/sysdeps/mach/hurd/i386/libpthread.abilist +++ b/sysdeps/mach/hurd/i386/libpthread.abilist @@ -57,7 +57,6 @@ GLIBC_2.12 pthread_rwlockattr_getpshared F GLIBC_2.12 pthread_rwlockattr_init F GLIBC_2.12 pthread_rwlockattr_setpshared F GLIBC_2.12 pthread_setcancelstate F -GLIBC_2.12 pthread_setcanceltype F GLIBC_2.12 pthread_setconcurrency F GLIBC_2.12 pthread_setschedprio F GLIBC_2.12 pthread_setspecific F diff --git a/sysdeps/mach/hurd/x86_64/libpthread.abilist b/sysdeps/mach/hurd/x86_64/libpthread.abilist index f4cee89580..800b7935fb 100644 --- a/sysdeps/mach/hurd/x86_64/libpthread.abilist +++ b/sysdeps/mach/hurd/x86_64/libpthread.abilist @@ -79,7 +79,6 @@ GLIBC_2.38 pthread_rwlockattr_getpshared F GLIBC_2.38 pthread_rwlockattr_init F GLIBC_2.38 pthread_rwlockattr_setpshared F GLIBC_2.38 pthread_setcancelstate F -GLIBC_2.38 pthread_setcanceltype F GLIBC_2.38 pthread_setconcurrency F GLIBC_2.38 pthread_setschedprio F GLIBC_2.38 pthread_setspecific F