From: Samuel Thibault Date: Sat, 22 Nov 2025 02:25:26 +0000 (+0000) Subject: htl: Also use __libc_thread_freeres to clean TLS state X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=604bdb0f8e9c0873b5420ec4429bd1dc40a41860;p=thirdparty%2Fglibc.git htl: Also use __libc_thread_freeres to clean TLS state --- diff --git a/htl/pt-exit.c b/htl/pt-exit.c index 9d331d0d81..db6d560b36 100644 --- a/htl/pt-exit.c +++ b/htl/pt-exit.c @@ -26,6 +26,7 @@ #include #include +#include /* Terminate the current thread and make STATUS available to any thread that might join it. */ @@ -49,6 +50,9 @@ __pthread_exit (void *status) /* Call destructors for the thread_local TLS variables. */ call_function_static_weak (__call_tls_dtors); + /* Clean up any state libc stored in thread-local variables. */ + __libc_thread_freeres (); + __pthread_setcancelstate (oldstate, &oldstate); /* Decrease the number of threads. We use an atomic operation to diff --git a/include/libc-internal.h b/include/libc-internal.h index 91ff0de1d7..e9f7bec5bf 100644 --- a/include/libc-internal.h +++ b/include/libc-internal.h @@ -35,11 +35,7 @@ extern void __libc_freeres (void); libc_hidden_proto (__libc_freeres) /* Free resources stored in thread-local variables on thread exit. */ -extern void __libc_thread_freeres (void) -#if PTHREAD_IN_LIBC - attribute_hidden -#endif - ; +extern void __libc_thread_freeres (void) attribute_hidden; /* Define and initialize `__progname' et. al. */ extern void __init_misc (int, char **, char **) attribute_hidden;