diff options
| author | Samuel Thibault <samuel.thibault@ens-lyon.org> | 2025-11-22 02:25:26 +0000 |
|---|---|---|
| committer | Samuel Thibault <samuel.thibault@ens-lyon.org> | 2025-11-22 03:27:40 +0100 |
| commit | 604bdb0f8e9c0873b5420ec4429bd1dc40a41860 (patch) | |
| tree | 5679f56811159583098c15a3763f895fd1a9883a | |
| parent | aa6066087f5a4d709ff148591d4a58564e2b09bf (diff) | |
htl: Also use __libc_thread_freeres to clean TLS state
| -rw-r--r-- | htl/pt-exit.c | 4 | ||||
| -rw-r--r-- | include/libc-internal.h | 6 |
2 files changed, 5 insertions, 5 deletions
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 <atomic.h> #include <shlib-compat.h> +#include <libc-internal.h> /* 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; |
