mirror of
https://sourceware.org/git/glibc.git
synced 2025-07-30 22:43:12 +03:00
C++11 thread_local destructors support
This feature is specifically for the C++ compiler to offload calling thread_local object destructors on thread program exit, to glibc. This is to overcome the possible complication of destructors of thread_local objects getting called after the DSO in which they're defined is unloaded by the dynamic linker. The DSO is marked as 'unloadable' if it has a constructed thread_local object and marked as 'unloadable' again when all the constructed thread_local objects defined in it are destroyed.
This commit is contained in:
@ -33,6 +33,9 @@ attribute_hidden
|
||||
__run_exit_handlers (int status, struct exit_function_list **listp,
|
||||
bool run_list_atexit)
|
||||
{
|
||||
/* First, call the TLS destructors. */
|
||||
__call_tls_dtors ();
|
||||
|
||||
/* We do it this way to handle recursive calls to exit () made by
|
||||
the functions registered with `atexit' and `on_exit'. We call
|
||||
everyone on the list and use the status value in the last
|
||||
|
Reference in New Issue
Block a user