From patchwork Sun Mar 8 00:10:54 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Samuel Thibault X-Patchwork-Id: 131273 Return-Path: X-Original-To: patchwork@sourceware.org Delivered-To: patchwork@sourceware.org Received: from vm01.sourceware.org (localhost [127.0.0.1]) by sourceware.org (Postfix) with ESMTP id BA9254BA23E0 for ; Sun, 8 Mar 2026 00:11:25 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org BA9254BA23E0 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 4E2274BA23CB for ; Sun, 8 Mar 2026 00:10:56 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 4E2274BA23CB 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 4E2274BA23CB 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=1772928656; cv=none; b=ofBndQF1TszyRk36L2PrzCeFof96aUO3aNJ1p+LRA/NZNkIiUefW9jr+JGziLkY5yd0mUbwvdVbLDEblzp8kPiGclM2e+za/afFTvFgAkIYnZxD9evdLgqA3QlimeqGIU+eKDwjJj5laP2E3A1OG4a8i2UPAme6n+lzLEYddPvA= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1772928656; c=relaxed/simple; bh=DucKeM7/H0ROtwLNqFAJUfaJq++U5gtQKuJnjwVk05Q=; h=From:To:Subject:Date:Message-ID:MIME-Version; b=l9DJZljl3cvxohrZvrjlz1BlVU3BIZl4MvJ/IcrFtVdLKQXOpHt+SELFyF8Q9e3YYwvn/HhiUZh02JdeaDa+jOnBxTOgzL2yb9VAU3wmL30bRWH4KVW6wIOzvvs9TE3h5YpkKMhYG2alyyPVn9PAgNTGoUAyEoXNi6LIVb9nUkQ= ARC-Authentication-Results: i=1; server2.sourceware.org DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 4E2274BA23CB Received: from localhost (localhost [127.0.0.1]) by sonata.ens-lyon.org (Postfix) with ESMTP id 2B8E5A03B1; Sun, 8 Mar 2026 01:10:55 +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 9bmHW1Cgmtuf; Sun, 8 Mar 2026 01:10:55 +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 0CC5FA02C8; Sun, 8 Mar 2026 01:10:55 +0100 (CET) Received: from samy by end with local (Exim 4.99.1) (envelope-from ) id 1vz1jS-0000000EXim-2THD; Sun, 08 Mar 2026 01:10:54 +0100 From: Samuel Thibault To: libc-alpha@sourceware.org Cc: Samuel Thibault , commit-hurd@gnu.org, Brent Baccala Subject: [hurd, commited] htl: Call thread-specific destructors for last thread too Date: Sun, 8 Mar 2026 01:10:54 +0100 Message-ID: <20260308001054.3466209-1-samuel.thibault@ens-lyon.org> X-Mailer: git-send-email 2.51.0 MIME-Version: 1.0 X-Spam-Status: No, score=-12.1 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 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 As required by posix. Reported-by: Brent Baccala 's Claude assistant --- htl/pt-exit.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/htl/pt-exit.c b/htl/pt-exit.c index ad60f063ed..e08b3252cf 100644 --- a/htl/pt-exit.c +++ b/htl/pt-exit.c @@ -55,15 +55,15 @@ __pthread_exit (void *status) __pthread_setcancelstate (oldstate, &oldstate); + /* Destroy any thread specific data. */ + __pthread_destroy_specific (self); + /* Decrease the number of threads. We use an atomic operation to make sure that only the last thread calls `exit'. */ if (atomic_fetch_add_relaxed (&__pthread_total, -1) == 1) /* We are the last thread. */ exit (0); - /* Destroy any thread specific data. */ - __pthread_destroy_specific (self); - /* Note that after this point the process can be terminated at any point if another thread calls `pthread_exit' and happens to be the last thread. */