From: GNU Libc Maintainers Date: Tue, 3 Oct 2023 17:14:06 +0000 (+0100) Subject: git-tls_dtors X-Git-Tag: archive/raspbian/2.37-12+rpi1^2~54 X-Git-Url: https://dgit.raspbian.org/?a=commitdiff_plain;h=fa73e93b2db03a962b0f95a57569c5bb74998049;p=glibc.git git-tls_dtors commit 89ade8d8cb4c4f015942ab9b1319397b223012cf Author: Samuel Thibault 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 --- diff --git a/htl/pt-exit.c b/htl/pt-exit.c index b1cbe8586..22b585bb2 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