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