htl: thread_local destructors support

This commit is contained in:
Samuel Thibault 2023-09-03 15:23:56 +02:00
parent d2123d6827
commit 89ade8d8cb

View File

@ -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