git-tls_dtors
authorGNU Libc Maintainers <debian-glibc@lists.debian.org>
Tue, 3 Oct 2023 17:14:06 +0000 (18:14 +0100)
committerAurelien Jarno <aurel32@debian.org>
Tue, 3 Oct 2023 17:14:06 +0000 (18:14 +0100)
commit 89ade8d8cb4c4f015942ab9b1319397b223012cf
Author: Samuel Thibault <samuel.thibault@ens-lyon.org>
Date:   Sun Sep 3 15:23:56 2023 +0200

    htl: thread_local destructors support

Gbp-Pq: Topic hurd-i386
Gbp-Pq: Name git-tls_dtors.diff

htl/pt-exit.c

index b1cbe85861b002f6f10c0416d9c4794af0c867be..22b585bb28b8c84bae240005f779b8c76c5b5b53 100644 (file)
@@ -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