From: GNU Libc Maintainers Date: Fri, 8 Sep 2023 18:39:29 +0000 (+0100) Subject: git-tls_dtors X-Git-Tag: archive/raspbian/2.37-12+rpi1^2^2^2~54 X-Git-Url: https://dgit.raspbian.org/?a=commitdiff_plain;h=b574b77f3cfee8d52741b0c4ab110bb17219ae46;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