public inbox for glibc-cvs@sourceware.org
help / color / mirror / Atom feed
From: Samuel Thibault <sthibaul@sourceware.org>
To: glibc-cvs@sourceware.org
Subject: [glibc] htl: thread_local destructors support
Date: Sun,  3 Sep 2023 13:24:19 +0000 (GMT)	[thread overview]
Message-ID: <20230903132419.EC03A3858D33@sourceware.org> (raw)

https://sourceware.org/git/gitweb.cgi?p=glibc.git;h=89ade8d8cb4c4f015942ab9b1319397b223012cf

commit 89ade8d8cb4c4f015942ab9b1319397b223012cf
Author: Samuel Thibault <samuel.thibault@ens-lyon.org>
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

                 reply	other threads:[~2023-09-03 13:24 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20230903132419.EC03A3858D33@sourceware.org \
    --to=sthibaul@sourceware.org \
    --cc=glibc-cvs@sourceware.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).