From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 1792) id EC03A3858D33; Sun, 3 Sep 2023 13:24:19 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org EC03A3858D33 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1693747459; bh=HkVjnjoRMq019EwDSF9WPh4Nsqhx0JR+I+tTNB/ceaA=; h=From:To:Subject:Date:From; b=boppepQaT5gYIF1wDKr4yTp6MA0MAWMLg2QP4cAFbKPpBqobJLnB0y9LaPsv4BYkS WSZYf7yrmxCPy2Fx1lSGQ19D4JphvBI0GQQeDuC7Sg3YNusz9cUZ9S8FGEQLTzpvRz UkS5ZhhRtvBBf7YeSthBlgoWi4ZB1CeI6SxdQry0= Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: Samuel Thibault To: glibc-cvs@sourceware.org Subject: [glibc] htl: thread_local destructors support X-Act-Checkin: glibc X-Git-Author: Samuel Thibault X-Git-Refname: refs/heads/master X-Git-Oldrev: d2123d68275acc0f061e73d5f86ca504e0d5a344 X-Git-Newrev: 89ade8d8cb4c4f015942ab9b1319397b223012cf Message-Id: <20230903132419.EC03A3858D33@sourceware.org> Date: Sun, 3 Sep 2023 13:24:19 +0000 (GMT) List-Id: https://sourceware.org/git/gitweb.cgi?p=glibc.git;h=89ade8d8cb4c4f015942ab9b1319397b223012cf commit 89ade8d8cb4c4f015942ab9b1319397b223012cf Author: Samuel Thibault Date: Sun Sep 3 15:23:56 2023 +0200 htl: thread_local destructors support Diff: --- htl/pt-exit.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/htl/pt-exit.c b/htl/pt-exit.c index b1cbe85861..22b585bb28 100644 --- a/htl/pt-exit.c +++ b/htl/pt-exit.c @@ -46,6 +46,12 @@ __pthread_exit (void *status) *handlers = (*handlers)->__next) (*handlers)->__handler ((*handlers)->__arg); + /* Call destructors for the thread_local TLS variables. */ +#ifndef SHARED + if (&__call_tls_dtors != NULL) +#endif + __call_tls_dtors (); + __pthread_setcancelstate (oldstate, &oldstate); /* Decrease the number of threads. We use an atomic operation to