From ba384f6ed9275f3966505f2375b56d169e3dc588 Mon Sep 17 00:00:00 2001 From: Siddhesh Poyarekar Date: Mon, 18 Feb 2013 19:08:21 +0530 Subject: 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. --- nptl/pthread_create.c | 3 +++ 1 file changed, 3 insertions(+) (limited to 'nptl') diff --git a/nptl/pthread_create.c b/nptl/pthread_create.c index 4fe0755..c6f2fdd 100644 --- a/nptl/pthread_create.c +++ b/nptl/pthread_create.c @@ -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 (); -- cgit v1.1