public inbox for libc-alpha@sourceware.org
 help / color / mirror / Atom feed
* Calling __cxa_thread_atexit_impl directly, from C code
@ 2022-08-26  8:31 Florian Weimer
  2022-08-29 18:59 ` Adhemerval Zanella Netto
  0 siblings, 1 reply; 7+ messages in thread
From: Florian Weimer @ 2022-08-26  8:31 UTC (permalink / raw)
  To: libc-alpha

Do we support calling __cxa_thread_atexit_impl directly?  The function
is not documented, nor is it declared in any installed header.

I think the answer is yes, because we support different C++
implementations, and they have to call __cxa_thread_atexit_impl for
thread-local destructors, either directly or through a wrapper
(__cxa_thread_atexit for libstdc++, as proposed for the Itanium C++
ABI).

There's interest in this because it's much easier to use than
pthread_key_create if you have to avoid linking against libpthread and
you target glibc releases between 2.18 and 2.33 (although it is possible
to use weak symbols, as in the libstdc++ implementation in
libstdc++-v3/libsupc++/atexit_thread.cc).

Thanks,
Florian


^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2022-09-06  6:44 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-08-26  8:31 Calling __cxa_thread_atexit_impl directly, from C code Florian Weimer
2022-08-29 18:59 ` Adhemerval Zanella Netto
2022-08-29 19:21   ` Florian Weimer
2022-08-29 19:56     ` Adhemerval Zanella Netto
2022-08-30  7:37       ` Florian Weimer
2022-08-30 12:56         ` Adhemerval Zanella Netto
2022-09-06  6:44           ` Florian Weimer

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).