From patchwork Sat Nov 22 02:28:05 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Samuel Thibault X-Patchwork-Id: 125013 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 26284385B536 for ; Sat, 22 Nov 2025 02:30:37 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 26284385B536 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 574E9385B508 for ; Sat, 22 Nov 2025 02:28:08 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 574E9385B508 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 574E9385B508 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=1763778488; cv=none; b=j5DyQJsdiyEfhsnyYi0o0eDgV1GkNUNlppzGbjQ++Wms0BPwdXg/XEd0I9wAnDJz/Rlqz75UBimQPqUIyKkpZu6neeQ0xNCDxq40IWyGeUylV1u4DqH25SEo1WfbA7UzHbEJ9SzI3spI6GsYzSsng4u4t4ipZ+8LW7OdUxWyOEI= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1763778488; c=relaxed/simple; bh=AMSIVr6tge9F/0Eq6eAbadjD+x+ye8Rdzfo+xpizdH8=; h=From:To:Subject:Date:Message-ID:MIME-Version; b=bI+IqgGMZw2m3Gr2OYJHAOHfC0ogweLjQ/JeUwvQNKrfXA5ymyJ9DrLe8vB8/JXpQpqrjyb2Zj7wnesnK3UE0ReJvBLAGKpXhL0F3gZg4P3ZK5GkWyzrQ0hSTuojqIw0a0R8FFICdGwsNiJ6sEjZSRlYomlyoZd8bu5gd5A8LUw= ARC-Authentication-Results: i=1; server2.sourceware.org DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 574E9385B508 Received: from localhost (localhost [127.0.0.1]) by sonata.ens-lyon.org (Postfix) with ESMTP id 15FF0A1D1D; Sat, 22 Nov 2025 03:28:07 +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 pJMEe9Rjb_Hg; Sat, 22 Nov 2025 03:28:07 +0100 (CET) Received: from end (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 D3DE3A1BC8; Sat, 22 Nov 2025 03:28:06 +0100 (CET) Received: from samy by end with local (Exim 4.99) (envelope-from ) id 1vMdM6-00000001ECd-1nWT; Sat, 22 Nov 2025 03:28:06 +0100 From: Samuel Thibault To: libc-alpha@sourceware.org Cc: Samuel Thibault , commit-hurd@gnu.org Subject: [hurd, commited] htl: Also use __libc_thread_freeres to clean TLS state Date: Sat, 22 Nov 2025 03:28:05 +0100 Message-ID: <20251122022805.292916-1-samuel.thibault@ens-lyon.org> X-Mailer: git-send-email 2.51.0 MIME-Version: 1.0 X-Spam-Status: No, score=-12.9 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 --- htl/pt-exit.c | 4 ++++ include/libc-internal.h | 6 +----- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/htl/pt-exit.c b/htl/pt-exit.c index 9d331d0d81..db6d560b36 100644 --- a/htl/pt-exit.c +++ b/htl/pt-exit.c @@ -26,6 +26,7 @@ #include #include +#include /* Terminate the current thread and make STATUS available to any thread that might join it. */ @@ -49,6 +50,9 @@ __pthread_exit (void *status) /* Call destructors for the thread_local TLS variables. */ call_function_static_weak (__call_tls_dtors); + /* Clean up any state libc stored in thread-local variables. */ + __libc_thread_freeres (); + __pthread_setcancelstate (oldstate, &oldstate); /* Decrease the number of threads. We use an atomic operation to diff --git a/include/libc-internal.h b/include/libc-internal.h index 91ff0de1d7..e9f7bec5bf 100644 --- a/include/libc-internal.h +++ b/include/libc-internal.h @@ -35,11 +35,7 @@ extern void __libc_freeres (void); libc_hidden_proto (__libc_freeres) /* Free resources stored in thread-local variables on thread exit. */ -extern void __libc_thread_freeres (void) -#if PTHREAD_IN_LIBC - attribute_hidden -#endif - ; +extern void __libc_thread_freeres (void) attribute_hidden; /* Define and initialize `__progname' et. al. */ extern void __init_misc (int, char **, char **) attribute_hidden;