From patchwork Sun Feb 16 23:03:06 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Samuel Thibault X-Patchwork-Id: 106645 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 49C8F3858C31 for ; Sun, 16 Feb 2025 23:04:16 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 49C8F3858C31 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 EB4413858D38 for ; Sun, 16 Feb 2025 23:03:14 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org EB4413858D38 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 EB4413858D38 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=1739746995; cv=none; b=nxvVTOVe1SNFX6XZRakeZ8M0LQ0zHbTyrwWqr592slVxdi0TsMU01DXic9xiQ3Xzq8KFwNWfQmLEQYIbhwXw+uLOCCRJ5ka5xlZRVgy/1FH60OLqE2wPAj3Z86FQbJrfBipRRbc7XpdNUjX6Fq1zcq0Zn3nLOGVgsnfdbZFMeaI= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1739746995; c=relaxed/simple; bh=IIn8BCdNeKxzbFBTQprkV6tlVDpqvViZ20d8cdVNL9M=; h=From:To:Subject:Date:Message-ID:MIME-Version; b=xuz0ERiVksi19ZtKyukfiofN7fVJndt5oJgaGvnU0uSi4nH0W37rKb8ZdTJ8tyXcysP1hMg+VlBZopEhdYJhwSy7ye7K9Y6VXCFSVRd2ZkSAgbYVAU30QHM70MCPMQALMWVk+EkaAINtHyUfdbykPxrHZEn93Rs0+N9xesbBeNc= ARC-Authentication-Results: i=1; server2.sourceware.org DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org EB4413858D38 Received: from localhost (localhost [127.0.0.1]) by sonata.ens-lyon.org (Postfix) with ESMTP id DB5CFA0627; Mon, 17 Feb 2025 00:03:13 +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 EAny2OlMWJ0Q; Mon, 17 Feb 2025 00:03:13 +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 606B6A1C3C; Mon, 17 Feb 2025 00:03:13 +0100 (CET) Received: from samy by begin with local (Exim 4.98) (envelope-from ) id 1tjnfM-0000000D0a1-3UHQ; Mon, 17 Feb 2025 00:03:12 +0100 From: Samuel Thibault To: libc-alpha@sourceware.org Cc: gfleury , commit-hurd@gnu.org Subject: [hurd,commited 06/10] htl: move pthread_rwlock_unlock into libc. Date: Mon, 17 Feb 2025 00:03:06 +0100 Message-ID: <20250216230311.3097176-7-samuel.thibault@ens-lyon.org> X-Mailer: git-send-email 2.47.2 In-Reply-To: <20250216230311.3097176-1-samuel.thibault@ens-lyon.org> References: <20250216230311.3097176-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 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 Signed-off-by: gfleury Message-ID: <20250216145434.7089-7-gfleury@disroot.org> --- htl/Makefile | 2 +- htl/Versions | 4 +++- htl/pt-initialize.c | 1 - sysdeps/htl/libc-lockP.h | 3 +-- sysdeps/htl/pt-rwlock-unlock.c | 8 +++++++- sysdeps/htl/pthread-functions.h | 2 -- sysdeps/mach/hurd/i386/libc.abilist | 2 ++ sysdeps/mach/hurd/i386/libpthread.abilist | 1 - sysdeps/mach/hurd/x86_64/libc.abilist | 2 ++ sysdeps/mach/hurd/x86_64/libpthread.abilist | 1 - 10 files changed, 16 insertions(+), 10 deletions(-) diff --git a/htl/Makefile b/htl/Makefile index 0c85ab462c..d5ab98c840 100644 --- a/htl/Makefile +++ b/htl/Makefile @@ -51,7 +51,6 @@ libpthread-routines := \ pt-rwlock-wrlock \ pt-rwlock-timedrdlock \ pt-rwlock-timedwrlock \ - pt-rwlock-unlock \ pt-hurd-cond-wait \ pt-hurd-cond-timedwait \ pt-stack-alloc \ @@ -197,6 +196,7 @@ routines := \ pt-rwlock-attr \ pt-rwlock-tryrdlock \ pt-rwlock-trywrlock \ + pt-rwlock-unlock \ pt-rwlockattr-destroy \ pt-rwlockattr-getpshared \ pt-rwlockattr-init \ diff --git a/htl/Versions b/htl/Versions index ca59cd5c99..9669fe9dbc 100644 --- a/htl/Versions +++ b/htl/Versions @@ -65,6 +65,7 @@ libc { pthread_mutexattr_settype; pthread_rwlock_tryrdlock; pthread_rwlock_trywrlock; + pthread_rwlock_unlock; pthread_rwlockattr_destroy; pthread_rwlockattr_getpshared; pthread_rwlockattr_init; @@ -150,6 +151,7 @@ libc { pthread_mutex_trylock; pthread_rwlock_tryrdlock; pthread_rwlock_trywrlock; + pthread_rwlock_unlock; pthread_rwlockattr_destroy; pthread_rwlockattr_getpshared; pthread_rwlockattr_init; @@ -251,7 +253,7 @@ libpthread { pthread_rwlock_destroy; pthread_rwlock_init; pthread_rwlock_rdlock; pthread_rwlock_timedrdlock; pthread_rwlock_timedwrlock; - pthread_rwlock_unlock; pthread_rwlock_wrlock; + pthread_rwlock_wrlock; pthread_setconcurrency; pthread_setschedprio; pthread_setspecific; diff --git a/htl/pt-initialize.c b/htl/pt-initialize.c index 53b9c76e8f..14172099d4 100644 --- a/htl/pt-initialize.c +++ b/htl/pt-initialize.c @@ -32,7 +32,6 @@ static const struct pthread_functions pthread_functions = { .ptr_pthread_once = __pthread_once, .ptr_pthread_rwlock_rdlock = __pthread_rwlock_rdlock, .ptr_pthread_rwlock_wrlock = __pthread_rwlock_wrlock, - .ptr_pthread_rwlock_unlock = __pthread_rwlock_unlock, .ptr___pthread_key_create = __pthread_key_create, .ptr___pthread_getspecific = __pthread_getspecific, .ptr___pthread_setspecific = __pthread_setspecific, diff --git a/sysdeps/htl/libc-lockP.h b/sysdeps/htl/libc-lockP.h index 5fad451dfc..7e9bdd1c4b 100644 --- a/sysdeps/htl/libc-lockP.h +++ b/sysdeps/htl/libc-lockP.h @@ -106,6 +106,7 @@ extern int __pthread_rwlock_trywrlock (pthread_rwlock_t *__rwlock); libc_hidden_proto (__pthread_rwlock_trywrlock) extern int __pthread_rwlock_unlock (pthread_rwlock_t *__rwlock); +libc_hidden_proto (__pthread_rwlock_unlock) extern int __pthread_once (pthread_once_t *__once_control, void (*__init_routine) (void)); @@ -124,7 +125,6 @@ weak_extern (__pthread_rwlock_init) weak_extern (__pthread_rwlock_destroy) weak_extern (__pthread_rwlock_rdlock) weak_extern (__pthread_rwlock_wrlock) -weak_extern (__pthread_rwlock_unlock) weak_extern (__pthread_key_create) weak_extern (__pthread_setspecific) weak_extern (__pthread_getspecific) @@ -135,7 +135,6 @@ weak_extern (__pthread_atfork) # pragma weak __pthread_rwlock_destroy # pragma weak __pthread_rwlock_rdlock # pragma weak __pthread_rwlock_wrlock -# pragma weak __pthread_rwlock_unlock # pragma weak __pthread_key_create # pragma weak __pthread_setspecific # pragma weak __pthread_getspecific diff --git a/sysdeps/htl/pt-rwlock-unlock.c b/sysdeps/htl/pt-rwlock-unlock.c index 6465ace772..5012add1f9 100644 --- a/sysdeps/htl/pt-rwlock-unlock.c +++ b/sysdeps/htl/pt-rwlock-unlock.c @@ -19,6 +19,7 @@ #include #include +#include /* Unlock *RWLOCK, rescheduling a waiting writer thread or, if there are no threads waiting for a write lock, rescheduling the reader @@ -95,4 +96,9 @@ __pthread_rwlock_unlock (pthread_rwlock_t *rwlock) __pthread_spin_unlock (&rwlock->__lock); return 0; } -weak_alias (__pthread_rwlock_unlock, pthread_rwlock_unlock); +libc_hidden_def (__pthread_rwlock_unlock) +versioned_symbol (libc, __pthread_rwlock_unlock, pthread_rwlock_unlock, GLIBC_2_42); + +#if OTHER_SHLIB_COMPAT (libpthread, GLIBC_2_12, GLIBC_2_42) +compat_symbol (libpthread, __pthread_rwlock_unlock, pthread_rwlock_unlock, GLIBC_2_12); +#endif diff --git a/sysdeps/htl/pthread-functions.h b/sysdeps/htl/pthread-functions.h index 56b5b2383e..7dd6fadc17 100644 --- a/sysdeps/htl/pthread-functions.h +++ b/sysdeps/htl/pthread-functions.h @@ -26,7 +26,6 @@ struct __pthread_cancelation_handler **__pthread_get_cleanup_stack (void); int __pthread_once (pthread_once_t *, void (*) (void)); int __pthread_rwlock_rdlock (pthread_rwlock_t *); int __pthread_rwlock_wrlock (pthread_rwlock_t *); -int __pthread_rwlock_unlock (pthread_rwlock_t *); int __pthread_key_create (pthread_key_t *, void (*) (void *)); void *__pthread_getspecific (pthread_key_t); int __pthread_setspecific (pthread_key_t, const void *); @@ -45,7 +44,6 @@ struct pthread_functions int (*ptr_pthread_once) (pthread_once_t *, void (*) (void)); int (*ptr_pthread_rwlock_rdlock) (pthread_rwlock_t *); int (*ptr_pthread_rwlock_wrlock) (pthread_rwlock_t *); - int (*ptr_pthread_rwlock_unlock) (pthread_rwlock_t *); int (*ptr___pthread_key_create) (pthread_key_t *, void (*) (void *)); void *(*ptr___pthread_getspecific) (pthread_key_t); int (*ptr___pthread_setspecific) (pthread_key_t, const void *); diff --git a/sysdeps/mach/hurd/i386/libc.abilist b/sysdeps/mach/hurd/i386/libc.abilist index 3d786282fa..8df2a87d6a 100644 --- a/sysdeps/mach/hurd/i386/libc.abilist +++ b/sysdeps/mach/hurd/i386/libc.abilist @@ -90,6 +90,7 @@ GLIBC_2.12 pthread_mutexattr_setpshared F GLIBC_2.12 pthread_mutexattr_settype F GLIBC_2.12 pthread_rwlock_tryrdlock F GLIBC_2.12 pthread_rwlock_trywrlock F +GLIBC_2.12 pthread_rwlock_unlock F GLIBC_2.12 pthread_rwlockattr_destroy F GLIBC_2.12 pthread_rwlockattr_getpshared F GLIBC_2.12 pthread_rwlockattr_init F @@ -2588,6 +2589,7 @@ GLIBC_2.42 pthread_mutex_setprioceiling F GLIBC_2.42 pthread_mutex_trylock F GLIBC_2.42 pthread_rwlock_tryrdlock F GLIBC_2.42 pthread_rwlock_trywrlock F +GLIBC_2.42 pthread_rwlock_unlock F GLIBC_2.42 pthread_rwlockattr_destroy F GLIBC_2.42 pthread_rwlockattr_getpshared F GLIBC_2.42 pthread_rwlockattr_init F diff --git a/sysdeps/mach/hurd/i386/libpthread.abilist b/sysdeps/mach/hurd/i386/libpthread.abilist index 70db951b10..8ba641f611 100644 --- a/sysdeps/mach/hurd/i386/libpthread.abilist +++ b/sysdeps/mach/hurd/i386/libpthread.abilist @@ -41,7 +41,6 @@ GLIBC_2.12 pthread_rwlock_init F GLIBC_2.12 pthread_rwlock_rdlock F GLIBC_2.12 pthread_rwlock_timedrdlock F GLIBC_2.12 pthread_rwlock_timedwrlock F -GLIBC_2.12 pthread_rwlock_unlock F GLIBC_2.12 pthread_rwlock_wrlock F GLIBC_2.12 pthread_setconcurrency F GLIBC_2.12 pthread_setschedprio F diff --git a/sysdeps/mach/hurd/x86_64/libc.abilist b/sysdeps/mach/hurd/x86_64/libc.abilist index 305cdb8cef..472c1b2ea8 100644 --- a/sysdeps/mach/hurd/x86_64/libc.abilist +++ b/sysdeps/mach/hurd/x86_64/libc.abilist @@ -1581,6 +1581,7 @@ GLIBC_2.38 pthread_mutexattr_setrobust_np F GLIBC_2.38 pthread_mutexattr_settype F GLIBC_2.38 pthread_rwlock_tryrdlock F GLIBC_2.38 pthread_rwlock_trywrlock F +GLIBC_2.38 pthread_rwlock_unlock F GLIBC_2.38 pthread_rwlockattr_destroy F GLIBC_2.38 pthread_rwlockattr_getpshared F GLIBC_2.38 pthread_rwlockattr_init F @@ -2271,6 +2272,7 @@ GLIBC_2.42 pthread_mutex_setprioceiling F GLIBC_2.42 pthread_mutex_trylock F GLIBC_2.42 pthread_rwlock_tryrdlock F GLIBC_2.42 pthread_rwlock_trywrlock F +GLIBC_2.42 pthread_rwlock_unlock F GLIBC_2.42 pthread_rwlockattr_destroy F GLIBC_2.42 pthread_rwlockattr_getpshared F GLIBC_2.42 pthread_rwlockattr_init F diff --git a/sysdeps/mach/hurd/x86_64/libpthread.abilist b/sysdeps/mach/hurd/x86_64/libpthread.abilist index b712a1b3bf..cd08c5f9c5 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_rwlock_init F GLIBC_2.38 pthread_rwlock_rdlock F GLIBC_2.38 pthread_rwlock_timedrdlock F GLIBC_2.38 pthread_rwlock_timedwrlock F -GLIBC_2.38 pthread_rwlock_unlock F GLIBC_2.38 pthread_rwlock_wrlock F GLIBC_2.38 pthread_setconcurrency F GLIBC_2.38 pthread_setschedprio F