This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
Re: [PATCH v2] Destructor support for C++11 thread_local variables- abilist entries
On Fri, 12 Oct 2012 11:26:26 -0700, Richard wrote:
> I don't like leaving a stale pointer like this. And this ignores the
> possibility of new items being added to the list during the list
> destruction process.
>
> Shall we write instead
>
> while (tls_dtor_list)
> {
> struct dtor_list *cur = tls_dtor_list;
> tls_dtor_list = cur->next;
> cur->func (cur->obj);
> free (cur);
> }
>
> This is much closer to how __run_exit_handlers is structured.
>
I'm going to look at the possibility of unloading the dso somehow,
either by counting the dtors and unloading when we know they're
all done (Jakub's idea) or dropping the dtors for other threads that are
defined in the dso and haven't been called yet. Jason confirmed
offline that the latter behaviour is also fine, but the former is
preferable since it is nicer to programmers.
Siddhesh