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:
@ -311,6 +311,9 @@ start_thread (void *arg)
|
||||
#endif
|
||||
}
|
||||
|
||||
/* Call destructors for the thread_local TLS variables. */
|
||||
__call_tls_dtors ();
|
||||
|
||||
/* Run the destructor for the thread-local data. */
|
||||
__nptl_deallocate_tsd ();
|
||||
|
||||
|
Reference in New Issue
Block a user