[cxx-abi-dev] Adding __cxa_thread_atexit() to the C++ ABI?

Matthew Dempsky matthew at dempsky.org
Fri Jun 7 23:45:01 UTC 2013


It looks like GCC and Clang have both decided to use
__cxa_thread_atexit() to register destructors for C++11 thread_local
objects:

http://gcc.gnu.org/viewcvs/gcc/trunk/gcc/cp/decl.c?view=co
http://llvm.org/svn/llvm-project/cfe/trunk/lib/CodeGen/ItaniumCXXABI.cpp

The semantics seem to be described here (but under the name
__cxa_thread_atexit_impl()):

http://sourceware.org/glibc/wiki/Destructor%20support%20for%20thread_local%20variables

Can/will this function be added to the C++ ABI as well?

It looks like there was some discussion about this back in September
(http://sourcerytools.com/pipermail/cxx-abi-dev/2012-September/002472.html),
but I don't see any subsequent discussion about standardizing the name
and semantics.


More information about the cxx-abi-dev mailing list