From patchwork Fri Jan 3 10:37:45 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: gfleury X-Patchwork-Id: 103937 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 419203858C62 for ; Fri, 3 Jan 2025 10:41:16 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 419203858C62 Authentication-Results: sourceware.org; dkim=pass (2048-bit key, secure) header.d=disroot.org header.i=@disroot.org header.a=rsa-sha256 header.s=mail header.b=GfcWEJJF X-Original-To: libc-alpha@sourceware.org Delivered-To: libc-alpha@sourceware.org Received: from layka.disroot.org (layka.disroot.org [178.21.23.139]) by sourceware.org (Postfix) with ESMTPS id 7672C3858D21 for ; Fri, 3 Jan 2025 10:38:25 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 7672C3858D21 Authentication-Results: sourceware.org; dmarc=pass (p=reject dis=none) header.from=disroot.org Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=disroot.org ARC-Filter: OpenARC Filter v1.0.0 sourceware.org 7672C3858D21 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=178.21.23.139 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1735900705; cv=none; b=PdyuOMPeBUmlt5k8HcKHhTYaqaNdaDMSnm99sohm0/ybXCXD03oHVRtFPZys0b8lVTeklKoBEjI+I9xcfNOych9knAfRhzWpkj56tkD+/70BBuMIRC6dJcBB2Y0d1PW5y3T8V9fhY3fnYQQzTOpyGYabRYbkG4O6Mo5ehCSr7L0= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1735900705; c=relaxed/simple; bh=fDkVEaroH9BLM9c4/NGBssshCkuI5WEVzqq+eq8uWsM=; h=DKIM-Signature:From:To:Subject:Date:Message-Id:MIME-Version; b=sdAvnkWJcxSToMOUZzFDIaLPnAlgt1TTcLyrM/1Nxt7Qmmw/Ztcuspu6Og/IIWeJfvkZs40d3FS3RBb2yY/PnOEtCcrMZNfbV/qJBu5NPqC1yOUmjyRKOz6tqKzMxJ6HII8czdG9iACRL6VH4YBlGfL+0+I2agAnYaKyG2G9tLw= ARC-Authentication-Results: i=1; server2.sourceware.org DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 7672C3858D21 Received: from mail01.disroot.lan (localhost [127.0.0.1]) by disroot.org (Postfix) with ESMTP id 512662591B; Fri, 3 Jan 2025 11:38:24 +0100 (CET) X-Virus-Scanned: SPAM Filter at disroot.org Received: from layka.disroot.org ([127.0.0.1]) by localhost (disroot.org [127.0.0.1]) (amavis, port 10024) with ESMTP id wzNl1SZ2h86m; Fri, 3 Jan 2025 11:38:23 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=disroot.org; s=mail; t=1735900703; bh=fDkVEaroH9BLM9c4/NGBssshCkuI5WEVzqq+eq8uWsM=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=GfcWEJJF8kUNdszN4ZseIIR6BEI2pvJYFFeYfnJ5hDXIxoO5aVf/x4F5X52gZUeW4 J9hn7Mtub3jS+vON89rWmJ8jagKPJJH0BG+JIN6McJmSMOCNv9jsUN/sbRyE6Sxrs2 ZYfDaasiTf09z1kQLsLjn629R0zgLaFia7JSBsYYoSbg9LXl6QDur9yyElVGpuf1LQ 4DBKX4+G8u8YfEg9pKQnzkMJfclDniVZg0SCxY2ktVxZ7WCjiNoWFZ0zAbA6nYkFB8 BMywHfEzXgY7xY9I5B0bPiCBhIgpehfWpxTCqXYISnJJtqjonDv85RIvG554CT3OKv HA0Rafc2T/9nQ== From: gfleury To: libc-alpha@sourceware.org Cc: gfleury Subject: [PATCH 1/6] ht: move pthread_mutex_init into libc. Date: Fri, 3 Jan 2025 12:37:45 +0200 Message-Id: <20250103103750.870897-2-gfleury@disroot.org> In-Reply-To: <20250103103750.870897-1-gfleury@disroot.org> References: <20250103103750.870897-1-gfleury@disroot.org> MIME-Version: 1.0 X-Spam-Status: No, score=-11.9 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, SPF_HELO_NONE, 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 remove also leftover for pthread_mutexattr_settype in b386295727d35a83aa3d4750e198cbf8040c9a23 --- htl/Makefile | 2 +- htl/Versions | 5 +++-- htl/forward.c | 4 ---- htl/pt-initialize.c | 1 - sysdeps/htl/libc-lockP.h | 4 ---- sysdeps/htl/pthread-functions.h | 4 ---- sysdeps/htl/pthreadP.h | 6 ++---- 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, 14 insertions(+), 25 deletions(-) diff --git a/htl/Makefile b/htl/Makefile index 551d4c01..f381499f 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 f1393ebe..caa5653e 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 2b699c25..e7863756 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 a2332776..606a085d 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 a3a53e88..aeee2a24 100644 --- a/sysdeps/htl/libc-lockP.h +++ b/sysdeps/htl/libc-lockP.h @@ -120,12 +120,10 @@ 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) 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) @@ -141,12 +139,10 @@ 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 # 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/pthread-functions.h b/sysdeps/htl/pthread-functions.h index 97f42933..54b77334 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 20dd5a1c..16350e5d 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); @@ -39,6 +40,7 @@ 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); +libc_hidden_proto (__pthread_mutexattr_settype) extern int __pthread_mutexattr_getpshared(const pthread_mutexattr_t *__restrict __attr, int *__restrict __pshared); libc_hidden_proto (__pthread_mutexattr_getpshared) @@ -79,9 +81,6 @@ libc_hidden_proto (__pthread_mutexattr_setprotocol) extern int __pthread_mutexattr_gettype(const pthread_mutexattr_t *__restrict __attr, int *__restrict __type); libc_hidden_proto (__pthread_mutexattr_gettype) -extern int __pthread_mutexattr_settype(pthread_mutexattr_t *__attr, - int __type); -libc_hidden_proto (__pthread_mutexattr_settype) extern int __pthread_cond_init (pthread_cond_t *cond, const pthread_condattr_t *cond_attr); @@ -163,7 +162,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 2e019182..2039e0ba 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 aa8b9cec..6fb5d361 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 40f35ee0..e9559bd2 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 b925871a..6b330744 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 608901fb..047d685a 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 Fri Jan 3 10:37:46 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: gfleury X-Patchwork-Id: 103938 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 A1BF53858D28 for ; Fri, 3 Jan 2025 10:41:26 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org A1BF53858D28 Authentication-Results: sourceware.org; dkim=pass (2048-bit key, secure) header.d=disroot.org header.i=@disroot.org header.a=rsa-sha256 header.s=mail header.b=ZFZm3OV7 X-Original-To: libc-alpha@sourceware.org Delivered-To: libc-alpha@sourceware.org Received: from layka.disroot.org (layka.disroot.org [178.21.23.139]) by sourceware.org (Postfix) with ESMTPS id D10E03858D33 for ; Fri, 3 Jan 2025 10:38:30 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org D10E03858D33 Authentication-Results: sourceware.org; dmarc=pass (p=reject dis=none) header.from=disroot.org Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=disroot.org ARC-Filter: OpenARC Filter v1.0.0 sourceware.org D10E03858D33 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=178.21.23.139 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1735900716; cv=none; b=LZpGA3IOWx/+J9sX/Q+NQkMYqzWJWMllW3MSIkLe2AwwerSTLpj+QhtJoUIcr5LkLl241MQUW/IHBMHpZHcO/I87qgVnD3IL1d9IgwpSdpYgNDW0wTnI/brQxEBh5BppjmNDBhjhEKeqIXgMrhvh3LToSDDHj3EDBzISlyp1Mg4= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1735900716; c=relaxed/simple; bh=I2TCioO6ig1efuSlDdMjQmaLZ2WTIIAdMw67g1UeoFo=; h=DKIM-Signature:From:To:Subject:Date:Message-Id:MIME-Version; b=CWQyZAB59R3Qo3t97OZ9mSB3Nc0Vsc2m5daJuaw/7cxMCM8bEhXgvt0hqsXVwLpCBiSucI/qPpsEt14YeUHMeB97dcZdV2swp6OW7T1jaA9hkREsf7yKhz+BmyjSMvgGoFj6WGZnCCl3glAmfkkq7JnW8JyWBARuOasWYG10LDY= ARC-Authentication-Results: i=1; server2.sourceware.org DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org D10E03858D33 Received: from mail01.disroot.lan (localhost [127.0.0.1]) by disroot.org (Postfix) with ESMTP id A385225BDA; Fri, 3 Jan 2025 11:38:29 +0100 (CET) X-Virus-Scanned: SPAM Filter at disroot.org Received: from layka.disroot.org ([127.0.0.1]) by localhost (disroot.org [127.0.0.1]) (amavis, port 10024) with ESMTP id TF-OyWn1eF_h; Fri, 3 Jan 2025 11:38:25 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=disroot.org; s=mail; t=1735900705; bh=I2TCioO6ig1efuSlDdMjQmaLZ2WTIIAdMw67g1UeoFo=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=ZFZm3OV7sH3pEU6IpH/yMVx5s2sHjx/rB1cY/KYTOtTZpCBET6jsadngRtvsePcDc ZbMn2yBPIaPFarhS3jJGZwe/ZeaPed32JI2QkJPk7LX8t2NV2fYwZ5Seg3SS6HNyZf gxLgYmhXJM7GDCZxtcg9LEzs+9SUIbyzwUmK2TTsDv7Dnyrg5axnZOTeakxj62BNjO 4LJQ/R5JT6goS7oWx/qRFsiA5WoSx+NpJ5QBR6V5ysfFdEB/vkgRxNT6lZ4TzrRsrp BbYdb+LedY12AXRl3TsCJKr5QbeMnJ38CGEGzU3NBx2C0nPQcwuW0t0fGzvhSBEZWq 8bJ/gIlr/4tnw== From: gfleury To: libc-alpha@sourceware.org Cc: gfleury Subject: [PATCH 2/6] htl: move pthread_mutex_{lock, unlock, trylock, timedlock, clocklock} Date: Fri, 3 Jan 2025 12:37:46 +0200 Message-Id: <20250103103750.870897-3-gfleury@disroot.org> In-Reply-To: <20250103103750.870897-1-gfleury@disroot.org> References: <20250103103750.870897-1-gfleury@disroot.org> MIME-Version: 1.0 X-Spam-Status: No, score=-11.9 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, KAM_SHORT, SPF_HELO_NONE, 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 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 --- htl/Makefile | 8 ++++---- htl/Versions | 20 ++++++++++++-------- 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 | 5 +++++ sysdeps/mach/hurd/i386/libpthread.abilist | 5 ----- sysdeps/mach/hurd/x86_64/libc.abilist | 3 +++ sysdeps/mach/hurd/x86_64/libpthread.abilist | 5 ----- 18 files changed, 72 insertions(+), 65 deletions(-) diff --git a/htl/Makefile b/htl/Makefile index f381499f..0d3e78de 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 caa5653e..d262d7cd 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; @@ -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; } @@ -139,6 +145,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 +208,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 +251,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 +278,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 e7863756..b71099b8 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 606a085d..b8f8c95c 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 a9714434..5f591fb4 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 c013c599..0cfccc56 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 aeee2a24..b14ad5bd 100644 --- a/sysdeps/htl/libc-lockP.h +++ b/sysdeps/htl/libc-lockP.h @@ -121,9 +121,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) @@ -140,9 +137,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 54b77334..c44c9038 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 16350e5d..01dc5e3d 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_settype (pthread_mutexattr_t *attr, int kind); libc_hidden_proto (__pthread_mutexattr_settype) extern int __pthread_mutexattr_getpshared(const pthread_mutexattr_t *__restrict __attr, @@ -163,10 +170,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 2039e0ba..d6ee65d6 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 e1e40d8d..7d93ddd6 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 71ce28a3..90fa407e 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 54359212..b7a42e22 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_21); -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_21) +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 b1404161..1732c341 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 e9559bd2..7d660bae 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 diff --git a/sysdeps/mach/hurd/i386/libpthread.abilist b/sysdeps/mach/hurd/i386/libpthread.abilist index 6b330744..8c53b8d0 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 aaf55cba..996a49d8 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 diff --git a/sysdeps/mach/hurd/x86_64/libpthread.abilist b/sysdeps/mach/hurd/x86_64/libpthread.abilist index 047d685a..bd5e12ad 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 Fri Jan 3 10:37:47 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: gfleury X-Patchwork-Id: 103941 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 A74D13858D20 for ; Fri, 3 Jan 2025 10:45:29 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org A74D13858D20 Authentication-Results: sourceware.org; dkim=pass (2048-bit key, secure) header.d=disroot.org header.i=@disroot.org header.a=rsa-sha256 header.s=mail header.b=BybJj/ux X-Original-To: libc-alpha@sourceware.org Delivered-To: libc-alpha@sourceware.org Received: from layka.disroot.org (layka.disroot.org [178.21.23.139]) by sourceware.org (Postfix) with ESMTPS id 364F63858D38 for ; Fri, 3 Jan 2025 10:38:32 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 364F63858D38 Authentication-Results: sourceware.org; dmarc=pass (p=reject dis=none) header.from=disroot.org Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=disroot.org ARC-Filter: OpenARC Filter v1.0.0 sourceware.org 364F63858D38 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=178.21.23.139 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1735900712; cv=none; b=xL174N74xHsTHWrADaA/RE0jZeHrgIsdRUDpxxhmRo6/IP7LK2sC1c0iPlbVG0gTbrN9zg6zz9uRJYe4U9PV1QRU04Jp7UTiyG+JIGg8dc9XTOAVDnwWNrKmJiXErPNv9oDlIqhYadCFvgk/eCfBhL9ipHzw8DbzwmfUND5/UDo= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1735900712; c=relaxed/simple; bh=SAL178FZbmwvqNtrnF7atH2Reuw2DoaE3YLT7NM2we8=; h=DKIM-Signature:From:To:Subject:Date:Message-Id:MIME-Version; b=dsGJv+kAXMZZabg9IUOXUFVc60bXvKu3xxDFymHYxj8N3QJShd3kHd6eFStDYN72v6NUs2meaaaf8ncgRINQaZJCwS0VB0xSAidL6SYRQE3WZTJ32AqSfIiRZwLZm603bs2xCSI/oiui8yDUJ3OfyX8kaLd/kA1xTfhR5wq+i2U= ARC-Authentication-Results: i=1; server2.sourceware.org DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 364F63858D38 Received: from mail01.disroot.lan (localhost [127.0.0.1]) by disroot.org (Postfix) with ESMTP id 35EBB25C00; Fri, 3 Jan 2025 11:38:31 +0100 (CET) X-Virus-Scanned: SPAM Filter at disroot.org Received: from layka.disroot.org ([127.0.0.1]) by localhost (disroot.org [127.0.0.1]) (amavis, port 10024) with ESMTP id NPoglYDGyV3n; Fri, 3 Jan 2025 11:38:26 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=disroot.org; s=mail; t=1735900706; bh=SAL178FZbmwvqNtrnF7atH2Reuw2DoaE3YLT7NM2we8=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=BybJj/uxSBWeVXpwdLmayH6bGpJaxaN6NIE7EdIYgObozWHeZR/TQxVi9zc4DJ2ZL pYcYM8M+lNQrwp7WkhcoVXYTA+sYciYKQ6ws2/V8zEaJMYOp833SaRm2ox4ZEsQqme +VUiLmTj1CoRJb5WkLJdWbqyfWwk1SztHJHKXUQ1cLWD1MZwtwbJtECjsqvLOmz9t0 EFMa4fS+V1YfP3r806ZG9RIar3dm5R2v6OU4WkmayTlaLlL6lID78p2+MIdjwxO9hV YzsWZ9r2l+xrGNSTgHmwThd0M6pljcyHdUMmy/Mxr6bWpfawpoXGQ7oDOk19zKuY0A CtNGG42cT7Ehw== From: gfleury To: libc-alpha@sourceware.org Cc: gfleury Subject: [PATCH 3/6] htl: move pthread_mutex_getprioceiling, pthread_mutex_setprioceiling into libc Date: Fri, 3 Jan 2025 12:37:47 +0200 Message-Id: <20250103103750.870897-4-gfleury@disroot.org> In-Reply-To: <20250103103750.870897-1-gfleury@disroot.org> References: <20250103103750.870897-1-gfleury@disroot.org> MIME-Version: 1.0 X-Spam-Status: No, score=-11.9 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, KAM_SHORT, SPF_HELO_NONE, 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 --- 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 0d3e78de..f7e12983 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 d262d7cd..6f5c1616 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; @@ -103,6 +105,8 @@ libc { pthread_condattr_getpshared; pthread_condattr_setclock; pthread_condattr_setpshared; + pthread_mutex_getprioceiling; + pthread_mutex_setprioceiling; pthread_mutexattr_getprioceiling; pthread_mutexattr_getprotocol; pthread_mutexattr_getpshared; @@ -207,8 +211,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 01dc5e3d..c12ec157 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 7a8feadc..6b5893fe 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_41); +#if OTHER_SHLIB_COMPAT (libpthread, GLIBC_2_12, GLIBC_2_41) +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 6ccce833..6bbab019 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_41); +#if OTHER_SHLIB_COMPAT (libpthread, GLIBC_2_12, GLIBC_2_41) +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 7d660bae..35857a24 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 @@ -2541,6 +2543,8 @@ GLIBC_2.41 pthread_condattr_getclock F GLIBC_2.41 pthread_condattr_getpshared F GLIBC_2.41 pthread_condattr_setclock F GLIBC_2.41 pthread_condattr_setpshared F +GLIBC_2.41 pthread_mutex_getprioceiling F +GLIBC_2.41 pthread_mutex_setprioceiling F GLIBC_2.41 pthread_mutexattr_getprioceiling F GLIBC_2.41 pthread_mutexattr_getprotocol F GLIBC_2.41 pthread_mutexattr_getpshared F diff --git a/sysdeps/mach/hurd/i386/libpthread.abilist b/sysdeps/mach/hurd/i386/libpthread.abilist index 8c53b8d0..0eb452eb 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 996a49d8..027c594c 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 @@ -2227,6 +2229,8 @@ GLIBC_2.41 pthread_condattr_getclock F GLIBC_2.41 pthread_condattr_getpshared F GLIBC_2.41 pthread_condattr_setclock F GLIBC_2.41 pthread_condattr_setpshared F +GLIBC_2.41 pthread_mutex_getprioceiling F +GLIBC_2.41 pthread_mutex_setprioceiling F GLIBC_2.41 pthread_mutexattr_getprioceiling F GLIBC_2.41 pthread_mutexattr_getprotocol F GLIBC_2.41 pthread_mutexattr_getpshared F diff --git a/sysdeps/mach/hurd/x86_64/libpthread.abilist b/sysdeps/mach/hurd/x86_64/libpthread.abilist index bd5e12ad..faeac21d 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 Fri Jan 3 10:37:48 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: gfleury X-Patchwork-Id: 103940 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 C24013858CDA for ; Fri, 3 Jan 2025 10:45:00 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org C24013858CDA Authentication-Results: sourceware.org; dkim=pass (2048-bit key, secure) header.d=disroot.org header.i=@disroot.org header.a=rsa-sha256 header.s=mail header.b=kOiDpbz7 X-Original-To: libc-alpha@sourceware.org Delivered-To: libc-alpha@sourceware.org Received: from layka.disroot.org (layka.disroot.org [178.21.23.139]) by sourceware.org (Postfix) with ESMTPS id 683533858D28 for ; Fri, 3 Jan 2025 10:38:30 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 683533858D28 Authentication-Results: sourceware.org; dmarc=pass (p=reject dis=none) header.from=disroot.org Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=disroot.org ARC-Filter: OpenARC Filter v1.0.0 sourceware.org 683533858D28 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=178.21.23.139 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1735900715; cv=none; b=sRU5wmhWKXvb2uJh8ajRRoBNmZgP/ls5KL1MtJi7WUtsw+C/2U+LA9UFVMcvjIAhKixhVsFPLknTOOZoiggsDF3oECqMau/u+icfO20aR9FzdBdSERmcWdYNohFg+MpEXmM4/jdrbyGQmV+lzMi1iGgJm9eTgU/QCyoq18vI34c= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1735900715; c=relaxed/simple; bh=Jg72eJez0iF+8k3e6W3x5pbM13Ya6+rgofWzvkuQ/qI=; h=DKIM-Signature:From:To:Subject:Date:Message-Id:MIME-Version; b=hVusZ6NmPUuvacnaBsyJ90Cobk4UiCMlevhHYPjQB6nnhlVesJ17MGFTIzhvJqv/Sf/oKjZs00xXNpcMV7gu2AavpaWVtAhfSH/DAe14Gzk7Ep+JD9AzB0msB92nhHlb+27T5IINpvzwh5o+cHJ4jbRKD+7LmBIh1sLC1NtPsRU= ARC-Authentication-Results: i=1; server2.sourceware.org DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 683533858D28 Received: from mail01.disroot.lan (localhost [127.0.0.1]) by disroot.org (Postfix) with ESMTP id 44E7725AAB; Fri, 3 Jan 2025 11:38:29 +0100 (CET) X-Virus-Scanned: SPAM Filter at disroot.org Received: from layka.disroot.org ([127.0.0.1]) by localhost (disroot.org [127.0.0.1]) (amavis, port 10024) with ESMTP id GZrQLttNv19S; Fri, 3 Jan 2025 11:38:28 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=disroot.org; s=mail; t=1735900708; bh=Jg72eJez0iF+8k3e6W3x5pbM13Ya6+rgofWzvkuQ/qI=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=kOiDpbz7k0EtlHYjucqAUoajHSwfDhTeII25AQZTtYJxxhPy+kflumahbM+0QBp7l Ah81YBYePRDGPNuopCWnBPVvft4yyssTP+ilhzA4RyTGZSJd/JjJKnGnVvU4j2QedQ SCCkPDH7d6yN38tgV16Jp0W/JFUJ1jaXz/L9iiaKwWAEyeiVkk3dO8HmoZGAAGVdwh nWTh2Ag5dCaNLm3UfN20T2DTsm2xP8nKejB/fem0G/1ZVNIPklhN2z+xPYP0ACTxC6 bbo+3q0fLCA9h6xP80HIFZQUIGQ8kN9SLHOyAzYFeHoOOEngqo2Eq3Cg7gX933EmwZ hzQCvw+2VyXYw== From: gfleury To: libc-alpha@sourceware.org Cc: gfleury Subject: [PATCH 4/6] htl: move pthread_mutex_destroy into libc. Date: Fri, 3 Jan 2025 12:37:48 +0200 Message-Id: <20250103103750.870897-5-gfleury@disroot.org> In-Reply-To: <20250103103750.870897-1-gfleury@disroot.org> References: <20250103103750.870897-1-gfleury@disroot.org> MIME-Version: 1.0 X-Spam-Status: No, score=-12.0 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, SPF_HELO_NONE, 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 --- 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 f7e12983..00aa8c1c 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 \ @@ -181,6 +180,7 @@ routines := \ pt-condattr-setclock \ pt-condattr-setpshared \ pt-getschedparam \ + pt-mutex-destroy \ pt-mutex-checklocked \ pt-mutex-getprioceiling \ pt-mutex-init \ diff --git a/htl/Versions b/htl/Versions index 6f5c1616..7ddd655d 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; @@ -148,6 +149,7 @@ libc { __pthread_condattr_init; __pthread_default_condattr; __pthread_mutex_checklocked; + __pthread_mutex_destroy; __pthread_mutex_init; __pthread_mutex_lock; __pthread_mutex_timedlock; @@ -211,7 +213,6 @@ libpthread { pthread_kill; __pthread_kill; - pthread_mutex_destroy; pthread_mutex_transfer_np; pthread_once; @@ -280,7 +281,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 b71099b8..63690291 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 b8f8c95c..5854bc49 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 b14ad5bd..83432ebe 100644 --- a/sysdeps/htl/libc-lockP.h +++ b/sysdeps/htl/libc-lockP.h @@ -120,7 +120,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) @@ -136,7 +135,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 c44c9038..45f15c26 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 c12ec157..a3fa624b 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, @@ -175,7 +174,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 fdb59623..c0624ec7 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 35857a24..fb1a17c6 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 0eb452eb..53b433c7 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 faeac21d..5f0f73d1 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 Fri Jan 3 10:37:49 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: gfleury X-Patchwork-Id: 103936 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 943893858C78 for ; Fri, 3 Jan 2025 10:40:52 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 943893858C78 Authentication-Results: sourceware.org; dkim=pass (2048-bit key, secure) header.d=disroot.org header.i=@disroot.org header.a=rsa-sha256 header.s=mail header.b=FJXhrg/d X-Original-To: libc-alpha@sourceware.org Delivered-To: libc-alpha@sourceware.org Received: from layka.disroot.org (layka.disroot.org [178.21.23.139]) by sourceware.org (Postfix) with ESMTPS id 015E33858D37 for ; Fri, 3 Jan 2025 10:38:31 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 015E33858D37 Authentication-Results: sourceware.org; dmarc=pass (p=reject dis=none) header.from=disroot.org Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=disroot.org ARC-Filter: OpenARC Filter v1.0.0 sourceware.org 015E33858D37 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=178.21.23.139 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1735900712; cv=none; b=Uy+dKqCzWNGBWsJmXoO2hUrQtHqzbjRUmpqBV1BskUzNl9gO4R+6Vu+2lkAlSoLZB3c4WDCmOZDMrdV4wG6L/uN6Gl/E/m35ebHkvS18idfHNNYTeL+be9B9nlZDAGlvWvES1Cr5FbgZpt9fRmpUS3YKOGxstMO01a0YFjixbQU= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1735900712; c=relaxed/simple; bh=dHEV6NLRsRGuPUVACjmzpr9zC/jCNRbdhCvISKdicyM=; h=DKIM-Signature:From:To:Subject:Date:Message-Id:MIME-Version; b=dbIW0frjlRrJv5L3WLTvksqGqFjjOoTRQ//VG+z6RO6iKDojZK7wv61XzBuxQT9St4pTcp97Hg2n9+KfWRl1XSxvgNMCpSROH6R4iRqMKgwiadAtu3WIFGO9f0c+2hLE/5thc51Cl+8+yrPINi9lPIgJL3xcPwmL0hJrAUFZmgI= ARC-Authentication-Results: i=1; server2.sourceware.org DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 015E33858D37 Received: from mail01.disroot.lan (localhost [127.0.0.1]) by disroot.org (Postfix) with ESMTP id 0099925B66; Fri, 3 Jan 2025 11:38:31 +0100 (CET) X-Virus-Scanned: SPAM Filter at disroot.org Received: from layka.disroot.org ([127.0.0.1]) by localhost (disroot.org [127.0.0.1]) (amavis, port 10024) with ESMTP id D3AlEbRKITHz; Fri, 3 Jan 2025 11:38:30 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=disroot.org; s=mail; t=1735900710; bh=dHEV6NLRsRGuPUVACjmzpr9zC/jCNRbdhCvISKdicyM=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=FJXhrg/djCEpm2+tTDNBMjd4b/r6Ty2Ih5DbooxK4kfJs+vI3p5ax0arKYqwZb4Bw LxpgDDVKVDkqK9KWptD8G6KH2/v0bLK4y/Xwmv5CLeOfwnQnHvtErf28gSd7GL/KwZ kppuI9R7/7KvST6F/F96ZUrLMnKAf83kOFQwvdi8d0xHv0911JqlhQCKdBYiaJwld+ 7dwPOufNWuaIVF8Ppt2qOFW/5ul//kwTeBewVtB7gYvrzzvIYijYyilXMdC1cNFI9T G/Hz/90uwIsAcyU9xwnbA/S5EBIafkPBnJih5uiuqKreAdE8V2B1g4SurC0eyRRxdw lvUBS8QlfS3tA== From: gfleury To: libc-alpha@sourceware.org Cc: gfleury Subject: [PATCH 5/6] htl: move pthread_mutex_consistent, pthread_mutex_consistent_np into libc. Date: Fri, 3 Jan 2025 12:37:49 +0200 Message-Id: <20250103103750.870897-6-gfleury@disroot.org> In-Reply-To: <20250103103750.870897-1-gfleury@disroot.org> References: <20250103103750.870897-1-gfleury@disroot.org> MIME-Version: 1.0 X-Spam-Status: No, score=-11.9 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, KAM_SHORT, SPF_HELO_NONE, 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 --- htl/Makefile | 2 +- htl/Versions | 4 ++-- sysdeps/htl/pthreadP.h | 2 ++ sysdeps/mach/hurd/htl/pt-mutex-consistent.c | 15 +++++++++++---- sysdeps/mach/hurd/i386/libc.abilist | 4 ++++ sysdeps/mach/hurd/i386/libpthread.abilist | 2 -- sysdeps/mach/hurd/x86_64/libc.abilist | 4 ++++ sysdeps/mach/hurd/x86_64/libpthread.abilist | 2 -- 8 files changed, 24 insertions(+), 11 deletions(-) diff --git a/htl/Makefile b/htl/Makefile index 00aa8c1c..5c81e05c 100644 --- a/htl/Makefile +++ b/htl/Makefile @@ -55,7 +55,6 @@ libpthread-routines := \ pt-testcancel \ pt-cancel \ pt-mutex-transfer-np \ - pt-mutex-consistent \ pt-rwlock-attr \ pt-rwlockattr-init \ pt-rwlockattr-destroy \ @@ -180,6 +179,7 @@ routines := \ pt-condattr-setclock \ pt-condattr-setpshared \ pt-getschedparam \ + pt-mutex-consistent \ pt-mutex-destroy \ pt-mutex-checklocked \ pt-mutex-getprioceiling \ diff --git a/htl/Versions b/htl/Versions index 7ddd655d..415faf15 100644 --- a/htl/Versions +++ b/htl/Versions @@ -89,6 +89,8 @@ libc { pthread_mutex_clocklock; + pthread_mutex_consistent; pthread_mutex_consistent_np; + pthread_mutexattr_getrobust; pthread_mutexattr_getrobust_np; pthread_mutexattr_setrobust; pthread_mutexattr_setrobust_np; } @@ -254,8 +256,6 @@ libpthread { cnd_broadcast; cnd_destroy; cnd_init; cnd_signal; cnd_timedwait; cnd_wait; tss_create; tss_delete; tss_get; tss_set; - pthread_mutex_consistent; pthread_mutex_consistent_np; - pthread_rwlock_clockrdlock; pthread_rwlock_clockwrlock; pthread_tryjoin_np; pthread_timedjoin_np; pthread_clockjoin_np; diff --git a/sysdeps/htl/pthreadP.h b/sysdeps/htl/pthreadP.h index a3fa624b..239caf36 100644 --- a/sysdeps/htl/pthreadP.h +++ b/sysdeps/htl/pthreadP.h @@ -36,6 +36,8 @@ libc_hidden_proto (__pthread_mutex_init) extern int __pthread_mutex_clocklock (pthread_mutex_t *__mutex, clockid_t __clockid, const struct timespec *__abstime); libc_hidden_proto (__pthread_mutex_clocklock) +extern int __pthread_mutex_consistent (pthread_mutex_t *__mtxp); +libc_hidden_proto (__pthread_mutex_consistent) extern int __pthread_mutex_lock (pthread_mutex_t *__mutex); libc_hidden_proto (__pthread_mutex_lock) extern int __pthread_mutex_getprioceiling (const pthread_mutex_t *__mutex, diff --git a/sysdeps/mach/hurd/htl/pt-mutex-consistent.c b/sysdeps/mach/hurd/htl/pt-mutex-consistent.c index ab9edd8a..d3baee6d 100644 --- a/sysdeps/mach/hurd/htl/pt-mutex-consistent.c +++ b/sysdeps/mach/hurd/htl/pt-mutex-consistent.c @@ -16,16 +16,17 @@ License along with the GNU C Library; if not, see . */ -#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_41); +versioned_symbol (libc, __pthread_mutex_consistent, pthread_mutex_consistent_np, GLIBC_2_41); + +#if OTHER_SHLIB_COMPAT (libpthread, GLIBC_2_32, GLIBC_2_41) +compat_symbol (libpthread, __pthread_mutex_consistent,pthread_mutex_consistent, GLIBC_2_32); +compat_symbol (libpthread, __pthread_mutex_consistent,pthread_mutex_consistent_np, GLIBC_2_32); +#endif diff --git a/sysdeps/mach/hurd/i386/libc.abilist b/sysdeps/mach/hurd/i386/libc.abilist index fb1a17c6..5916f47c 100644 --- a/sysdeps/mach/hurd/i386/libc.abilist +++ b/sysdeps/mach/hurd/i386/libc.abilist @@ -2272,6 +2272,8 @@ GLIBC_2.32 mach_print F GLIBC_2.32 mremap F GLIBC_2.32 pthread_cond_clockwait F GLIBC_2.32 pthread_mutex_clocklock F +GLIBC_2.32 pthread_mutex_consistent F +GLIBC_2.32 pthread_mutex_consistent_np F GLIBC_2.32 pthread_mutexattr_getrobust F GLIBC_2.32 pthread_mutexattr_getrobust_np F GLIBC_2.32 pthread_mutexattr_setrobust F @@ -2544,6 +2546,8 @@ GLIBC_2.41 pthread_condattr_getclock F GLIBC_2.41 pthread_condattr_getpshared F GLIBC_2.41 pthread_condattr_setclock F GLIBC_2.41 pthread_condattr_setpshared F +GLIBC_2.41 pthread_mutex_consistent F +GLIBC_2.41 pthread_mutex_consistent_np F GLIBC_2.41 pthread_mutex_getprioceiling F GLIBC_2.41 pthread_mutex_setprioceiling F GLIBC_2.41 pthread_mutexattr_getprioceiling F diff --git a/sysdeps/mach/hurd/i386/libpthread.abilist b/sysdeps/mach/hurd/i386/libpthread.abilist index 53b433c7..0877c0a8 100644 --- a/sysdeps/mach/hurd/i386/libpthread.abilist +++ b/sysdeps/mach/hurd/i386/libpthread.abilist @@ -99,8 +99,6 @@ GLIBC_2.32 mtx_timedlock F GLIBC_2.32 mtx_trylock F GLIBC_2.32 mtx_unlock F GLIBC_2.32 pthread_clockjoin_np F -GLIBC_2.32 pthread_mutex_consistent F -GLIBC_2.32 pthread_mutex_consistent_np F GLIBC_2.32 pthread_rwlock_clockrdlock F GLIBC_2.32 pthread_rwlock_clockwrlock F GLIBC_2.32 pthread_timedjoin_np F diff --git a/sysdeps/mach/hurd/x86_64/libc.abilist b/sysdeps/mach/hurd/x86_64/libc.abilist index 027c594c..d466e412 100644 --- a/sysdeps/mach/hurd/x86_64/libc.abilist +++ b/sysdeps/mach/hurd/x86_64/libc.abilist @@ -1548,6 +1548,8 @@ GLIBC_2.38 pthread_equal F GLIBC_2.38 pthread_exit F GLIBC_2.38 pthread_getschedparam F GLIBC_2.38 pthread_mutex_clocklock F +GLIBC_2.38 pthread_mutex_consistent F +GLIBC_2.38 pthread_mutex_consistent_np F GLIBC_2.38 pthread_mutex_destroy F GLIBC_2.38 pthread_mutex_getprioceiling F GLIBC_2.38 pthread_mutex_init F @@ -2229,6 +2231,8 @@ GLIBC_2.41 pthread_condattr_getclock F GLIBC_2.41 pthread_condattr_getpshared F GLIBC_2.41 pthread_condattr_setclock F GLIBC_2.41 pthread_condattr_setpshared F +GLIBC_2.41 pthread_mutex_consistent F +GLIBC_2.41 pthread_mutex_consistent_np F GLIBC_2.41 pthread_mutex_getprioceiling F GLIBC_2.41 pthread_mutex_setprioceiling F GLIBC_2.41 pthread_mutexattr_getprioceiling F diff --git a/sysdeps/mach/hurd/x86_64/libpthread.abilist b/sysdeps/mach/hurd/x86_64/libpthread.abilist index 5f0f73d1..f4cee895 100644 --- a/sysdeps/mach/hurd/x86_64/libpthread.abilist +++ b/sysdeps/mach/hurd/x86_64/libpthread.abilist @@ -61,8 +61,6 @@ GLIBC_2.38 pthread_join F GLIBC_2.38 pthread_key_create F GLIBC_2.38 pthread_key_delete F GLIBC_2.38 pthread_kill F -GLIBC_2.38 pthread_mutex_consistent F -GLIBC_2.38 pthread_mutex_consistent_np F GLIBC_2.38 pthread_mutex_transfer_np F GLIBC_2.38 pthread_once F GLIBC_2.38 pthread_rwlock_clockrdlock F From patchwork Fri Jan 3 10:37:50 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: gfleury X-Patchwork-Id: 103939 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 277873858C39 for ; Fri, 3 Jan 2025 10:41:34 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 277873858C39 Authentication-Results: sourceware.org; dkim=pass (2048-bit key, secure) header.d=disroot.org header.i=@disroot.org header.a=rsa-sha256 header.s=mail header.b=I+95izv8 X-Original-To: libc-alpha@sourceware.org Delivered-To: libc-alpha@sourceware.org Received: from layka.disroot.org (layka.disroot.org [178.21.23.139]) by sourceware.org (Postfix) with ESMTPS id 0301F3858D39 for ; Fri, 3 Jan 2025 10:38:37 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 0301F3858D39 Authentication-Results: sourceware.org; dmarc=pass (p=reject dis=none) header.from=disroot.org Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=disroot.org ARC-Filter: OpenARC Filter v1.0.0 sourceware.org 0301F3858D39 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=178.21.23.139 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1735900717; cv=none; b=n+r6IQ2OD58TGKTmPomAXfFiJid7TwH3nceXKh74OGQnbp3jRZOk28llqHUqT+uabCqySCsda8ldw3R3fFCQvXzsTFY+gvvlHUUtXbZTsTb4u755ixQJseml1ADr36AdAGlC/qOT50UoFT14jyKyko710wpvQoQndfIWcbhCuuw= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1735900717; c=relaxed/simple; bh=9AGzhpEtzS7sGV1xrAt9BWXuOMuIFT9oR3knaLO5wsY=; h=DKIM-Signature:From:To:Subject:Date:Message-Id:MIME-Version; b=nav33KeNXR7tJqaxXFPTDxIi5Ff0TwrodcSFLhMJV7xLK/mocrF5ocTPiSGgqS04ymP0KoPW8RrPOjKhkQsts6Y0NR+lWm1cVLzVZOq690Zbsar+Yj40Jrzfi3QFbe07ldk5HQEcoS+Msd5ANIm967/hYz8bMs/WIGuC+ZA2Zx4= ARC-Authentication-Results: i=1; server2.sourceware.org DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 0301F3858D39 Received: from mail01.disroot.lan (localhost [127.0.0.1]) by disroot.org (Postfix) with ESMTP id 0C1BD2591B; Fri, 3 Jan 2025 11:38:36 +0100 (CET) X-Virus-Scanned: SPAM Filter at disroot.org Received: from layka.disroot.org ([127.0.0.1]) by localhost (disroot.org [127.0.0.1]) (amavis, port 10024) with ESMTP id ACMoh57plZVL; Fri, 3 Jan 2025 11:38:31 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=disroot.org; s=mail; t=1735900711; bh=9AGzhpEtzS7sGV1xrAt9BWXuOMuIFT9oR3knaLO5wsY=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=I+95izv8jYa0h/VL9jh7m3EkibEhnYiE0IZTBZXQBPqWDC203n9FoB8AUScX46EsA UAO5+xVmEEA0pqk7zmecIB8ANdYKpthYbrdQaEUW5L89352D+OGwBfW0VHXnzHbLmB dZ2iZBAIHim3BXXaE3PgAD7kyMBY7/EWg+EO28ULKuVIKyRymMvWgg00jOqUy7Qom7 pENZGbL+QWtruFVzLUW1Dmya6FSxAqyCiP/BZNXStBZI21nSz1siIcUZVseUqKNv0j I3BNSuOeb/6prNmVUW7VehDaztZURcFNHa2LQ/PVsbUxtlXyN12d13wfbTKkMyjv5I KJGUQZBX3D4YQ== From: gfleury To: libc-alpha@sourceware.org Cc: gfleury Subject: [PATCH 6/6] htl: move pthread_setcanceltype into libc. Date: Fri, 3 Jan 2025 12:37:50 +0200 Message-Id: <20250103103750.870897-7-gfleury@disroot.org> In-Reply-To: <20250103103750.870897-1-gfleury@disroot.org> References: <20250103103750.870897-1-gfleury@disroot.org> MIME-Version: 1.0 X-Spam-Status: No, score=-11.9 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, KAM_SHORT, SPF_HELO_NONE, 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 --- 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 5c81e05c..e8e99669 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 415faf15..1185bbf4 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; } @@ -227,7 +228,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 63690291..9455df73 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 5854bc49..eba9e12d 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 f9474f9c..0b76fbfb 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 45f15c26..9788085b 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 239caf36..e0a58ea1 100644 --- a/sysdeps/htl/pthreadP.h +++ b/sysdeps/htl/pthreadP.h @@ -117,6 +117,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 5916f47c..3b55f9d0 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 0877c0a8..30b598ff 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 f4cee895..800b7935 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