This is the mail archive of the libc-alpha@sourceware.org mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Thread-local support for non-POD data objects


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]