From: Samuel Thibault Date: Sun, 3 Sep 2023 13:23:56 +0000 (+0200) Subject: htl: thread_local destructors support X-Git-Tag: glibc-2.39~449 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=89ade8d8cb4c4f015942ab9b1319397b223012cf;p=thirdparty%2Fglibc.git htl: thread_local destructors support --- diff --git a/htl/pt-exit.c b/htl/pt-exit.c index b1cbe85861b..22b585bb28b 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