From e86a92648f3b552f30c8ba395927ec083e18e805 Mon Sep 17 00:00:00 2001 From: GNU Libc Maintainers Date: Sat, 1 Jun 2024 23:16:35 +0200 Subject: [PATCH] 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 --- htl/pt-exit.c | 6 ++++++ 1 file changed, 6 insertions(+) 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 -- 2.30.2