Thread-local support for non-POD data objects
Siddhesh Poyarekar
siddhesh.poyarekar@gmail.com
Fri Jul 12 20:27:00 GMT 2013
On 13 July 2013 01:40, Rich Felker <dalias@aerifal.cx> wrote:
> Why is this needed in libc at all? My understanding is that the
> thread-local ctors run when the C++ thread-creation function is used,
> because pthread_create is called with a C++-implementation-internal
> start function wrapping the application-provided start function. If
> this is correct, then the start function provided by C++ could simply
> use pthread_cleanup_push to install a cleanup handler that runs the
> dtors, and run them manually with pthread_cleanup_pop(1) if the
> application's start function returns. This would cover both
> cancellation and pthread_exit or equivalent.
>
> Am I missing some obvious reason this would not work?
I had documented this when I wrote the patch:
http://sourceware.org/glibc/wiki/Destructor%20support%20for%20thread_local%20variables
Siddhesh
--
http://siddhesh.in
More information about the Libc-alpha
mailing list