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

Jason Merrill jason at redhat.com
Mon May 12 18:26:03 UTC 2014


On 05/08/2014 03:41 PM, Matthew Dempsky wrote:
> On Wed, May 7, 2014 at 11:41 AM, Jason Merrill <jason at redhat.com> wrote:
>> On 05/07/2014 01:15 PM, Matthew Dempsky wrote:
>>>
>>> +Additionally, the registration increments the reference count for DSO
>>> <code>d</code>.
>>
>>> +After <code>f(p)</code> returns, the reference count for DSO
>>> <code>d</code> is decremented.
>>
>> This seems overly specific to the glibc implementation; I would say
>> something more generic, perhaps just that the effect of dlclose with pending
>> cleanups is undefined.
>
> Any suggestions on appropriate relaxed wording?  Should I just remove
> this wording altogether?

"The effect of dlclosing a DSO with registered thread cleanups is 
undefined."

> Is it worth instead including some informative text reminding that
> C++11 requires destruction of objects with thread storage duration to
> be sequenced before destruction of objects with static storage
> duration, so implementations should make sure they DSO isn't unloaded
> (and its static objects destroyed) until all outstanding thread-local
> registrations have run (e.g., by holding a DSO reference count in the
> registration)?

That seems reasonable, I was just trying to allow for implementations 
that don't have any way to implement that, because they can't change the 
dynamic loader.

Jason



More information about the cxx-abi-dev mailing list