From patchwork Sat Aug 16 00:13:53 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Samuel Thibault X-Patchwork-Id: 118440 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 7C2DA3858C36 for ; Sat, 16 Aug 2025 00:18:57 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 7C2DA3858C36 X-Original-To: libc-alpha@sourceware.org Delivered-To: libc-alpha@sourceware.org Received: from sonata.ens-lyon.org (domu-toccata.ens-lyon.fr [140.77.166.138]) by sourceware.org (Postfix) with ESMTPS id 07EA63858C42 for ; Sat, 16 Aug 2025 00:14:22 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 07EA63858C42 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 07EA63858C42 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=1755303262; cv=none; b=ukFKGAXdxldqYrmuE1WdV/1EADwSTd17A5Z9XyEGqeq8JwzHMT/Ur3QBsTgb+hv4znwDGeN+jLdiwAgDEBq9vVT9wsyGYkjbSM+02+hbOqI5upRnA6/RFSJFAWKpAoi0KTinwIjjDIQL1/RbjI6J0L2X92RdvEA0q+pSj3quMHU= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1755303262; c=relaxed/simple; bh=pN4ZWhGMnHnUsj4intBq6Bo+EIVxXfADGKXXMRC0+fw=; h=From:To:Subject:Date:Message-ID:MIME-Version; b=YZdvm4AvF9H/JGqEvABsTv4ZalvFrJALA5Ypja1IzlMO53T0RFHbPiIRGOjt1LX7Rq7nBZBhq9O/qNrJ+FyYkOrJiHdtDyGiq6uTnsDu16+Mdw4yH6xqIFxn80oU32ssbw2nMtOVfuI4qtCv62QVsIGqXMrF3nxmVlO08Y0YnDU= ARC-Authentication-Results: i=1; server2.sourceware.org DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 07EA63858C42 Received: from localhost (localhost [127.0.0.1]) by sonata.ens-lyon.org (Postfix) with ESMTP id E9683A49C0; Sat, 16 Aug 2025 02:14:07 +0200 (CEST) Received: from sonata.ens-lyon.org ([127.0.0.1]) by localhost (sonata.ens-lyon.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id WqiS_lh-FT6U; Sat, 16 Aug 2025 02:14:07 +0200 (CEST) Received: from begin (165.21.205.77.rev.sfr.net [77.205.21.165]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (P-256) server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by sonata.ens-lyon.org (Postfix) with ESMTPSA id 6040FA49C7; Sat, 16 Aug 2025 02:14:07 +0200 (CEST) Received: from samy by begin with local (Exim 4.98.2) (envelope-from ) id 1un4Yg-00000000Wxt-1we8; Sat, 16 Aug 2025 02:14:06 +0200 From: Samuel Thibault To: libc-alpha@sourceware.org Cc: gfleury , commit-hurd@gnu.org Subject: [hurd,commited 07/19] htl: move pthread_yield into libc. Date: Sat, 16 Aug 2025 02:13:53 +0200 Message-ID: <20250816001405.126154-8-samuel.thibault@ens-lyon.org> X-Mailer: git-send-email 2.47.2 In-Reply-To: <20250816001405.126154-1-samuel.thibault@ens-lyon.org> References: <20250816001405.126154-1-samuel.thibault@ens-lyon.org> MIME-Version: 1.0 X-Spam-Status: No, score=-13.5 required=5.0 tests=BAYES_00, GIT_PATCH_0, JMQ_SPF_NEUTRAL, KAM_DMARC_STATUS, RCVD_IN_VALIDITY_RPBL_BLOCKED, RCVD_IN_VALIDITY_SAFE_BLOCKED, SPF_HELO_PASS, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org X-BeenThere: libc-alpha@sourceware.org X-Mailman-Version: 2.1.30 Precedence: list List-Id: Libc-alpha mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: libc-alpha-bounces~patchwork=sourceware.org@sourceware.org From: gfleury Message-ID: <20250815181500.107433-8-gfleury@disroot.org> --- htl/Makefile | 2 +- htl/Versions | 3 ++- htl/pt-yield.c | 9 ++++++++- 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 - 7 files changed, 15 insertions(+), 5 deletions(-) diff --git a/htl/Makefile b/htl/Makefile index be7db0ab5d..6c04a276b9 100644 --- a/htl/Makefile +++ b/htl/Makefile @@ -45,7 +45,6 @@ libpthread-routines := \ pt-spin \ pt-sigstate-init \ pt-kill \ - pt-yield \ pt-getname-np \ pt-setname-np \ sem_close \ @@ -211,6 +210,7 @@ routines := \ pt-timedblock \ pt-timedblock-intr \ pt-wakeup \ + pt-yield \ # routines shared-only-routines = forward diff --git a/htl/Versions b/htl/Versions index 68c7f01ed0..e6bd128925 100644 --- a/htl/Versions +++ b/htl/Versions @@ -90,6 +90,7 @@ libc { pthread_setschedprio; pthread_setspecific; pthread_sigmask; + pthread_yield; } GLIBC_2.21 { @@ -195,6 +196,7 @@ libc { pthread_getcpuclockid; pthread_setconcurrency; pthread_setschedprio; + pthread_yield; } GLIBC_PRIVATE { @@ -294,7 +296,6 @@ libpthread { pthread_mutex_transfer_np; pthread_testcancel; - pthread_yield; sem_close; sem_destroy; sem_getvalue; sem_init; sem_open; sem_post; sem_timedwait; sem_trywait; sem_unlink; sem_wait; diff --git a/htl/pt-yield.c b/htl/pt-yield.c index 0cab615a8d..f9f0b63437 100644 --- a/htl/pt-yield.c +++ b/htl/pt-yield.c @@ -18,9 +18,16 @@ #include #include +#include + int -pthread_yield (void) +__pthread_yield (void) { return __sched_yield (); } +versioned_symbol (libc, __pthread_yield, pthread_yield, GLIBC_2_43); + +#if OTHER_SHLIB_COMPAT (libpthread, GLIBC_2_12, GLIBC_2_43) +compat_symbol (libpthread, __pthread_yield, pthread_yield, GLIBC_2_12); +#endif diff --git a/sysdeps/mach/hurd/i386/libc.abilist b/sysdeps/mach/hurd/i386/libc.abilist index 791920f257..20cff5f143 100644 --- a/sysdeps/mach/hurd/i386/libc.abilist +++ b/sysdeps/mach/hurd/i386/libc.abilist @@ -117,6 +117,7 @@ GLIBC_2.12 pthread_setschedparam F GLIBC_2.12 pthread_setschedprio F GLIBC_2.12 pthread_setspecific F GLIBC_2.12 pthread_sigmask F +GLIBC_2.12 pthread_yield F GLIBC_2.13 __fentry__ F GLIBC_2.14 syncfs F GLIBC_2.15 __fdelt_chk F @@ -2641,6 +2642,7 @@ GLIBC_2.43 pthread_getconcurrency F GLIBC_2.43 pthread_getcpuclockid F GLIBC_2.43 pthread_setconcurrency F GLIBC_2.43 pthread_setschedprio F +GLIBC_2.43 pthread_yield F GLIBC_2.5 __readlinkat_chk F GLIBC_2.5 inet6_opt_append F GLIBC_2.5 inet6_opt_find F diff --git a/sysdeps/mach/hurd/i386/libpthread.abilist b/sysdeps/mach/hurd/i386/libpthread.abilist index 6c9ca8e194..b3afc039e5 100644 --- a/sysdeps/mach/hurd/i386/libpthread.abilist +++ b/sysdeps/mach/hurd/i386/libpthread.abilist @@ -34,7 +34,6 @@ GLIBC_2.12 pthread_spin_lock F GLIBC_2.12 pthread_spin_trylock F GLIBC_2.12 pthread_spin_unlock F GLIBC_2.12 pthread_testcancel F -GLIBC_2.12 pthread_yield F GLIBC_2.12 sem_close F GLIBC_2.12 sem_destroy F GLIBC_2.12 sem_getvalue F diff --git a/sysdeps/mach/hurd/x86_64/libc.abilist b/sysdeps/mach/hurd/x86_64/libc.abilist index 0e03d9dc05..88d180fcf2 100644 --- a/sysdeps/mach/hurd/x86_64/libc.abilist +++ b/sysdeps/mach/hurd/x86_64/libc.abilist @@ -1609,6 +1609,7 @@ GLIBC_2.38 pthread_setschedparam F GLIBC_2.38 pthread_setschedprio F GLIBC_2.38 pthread_setspecific F GLIBC_2.38 pthread_sigmask F +GLIBC_2.38 pthread_yield F GLIBC_2.38 ptrace F GLIBC_2.38 ptsname F GLIBC_2.38 ptsname_r F @@ -2323,6 +2324,7 @@ GLIBC_2.43 pthread_getconcurrency F GLIBC_2.43 pthread_getcpuclockid F GLIBC_2.43 pthread_setconcurrency F GLIBC_2.43 pthread_setschedprio F +GLIBC_2.43 pthread_yield F HURD_CTHREADS_0.3 __cthread_getspecific F HURD_CTHREADS_0.3 __cthread_keycreate F HURD_CTHREADS_0.3 __cthread_setspecific F diff --git a/sysdeps/mach/hurd/x86_64/libpthread.abilist b/sysdeps/mach/hurd/x86_64/libpthread.abilist index e68935dc5e..e76c359b1d 100644 --- a/sysdeps/mach/hurd/x86_64/libpthread.abilist +++ b/sysdeps/mach/hurd/x86_64/libpthread.abilist @@ -56,7 +56,6 @@ GLIBC_2.38 pthread_spin_unlock F GLIBC_2.38 pthread_testcancel F GLIBC_2.38 pthread_timedjoin_np F GLIBC_2.38 pthread_tryjoin_np F -GLIBC_2.38 pthread_yield F GLIBC_2.38 sem_clockwait F GLIBC_2.38 sem_close F GLIBC_2.38 sem_destroy F