[PATCH] Fix quick_exit to match C++11 specification.

Florian Weimer fweimer@redhat.com
Tue Jun 7 06:18:00 GMT 2016


On 06/07/2016 02:22 AM, Carlos O'Donell wrote:
> On 06/05/2016 11:13 AM, Florian Weimer wrote:
>> On 06/04/2016 05:54 AM, Carlos O'Donell wrote:
>> Do we really need a new version?  Is it correct to version
>> quick_exit? Would it be more correct to version
>> __cxa_thread_atexit_impl instead because whether the destructor runs
>> at thread exit seems more like a property of the code that registers
>> the destructor, than the code that invokes quick_exit?
>
> I don't quite follow.
>
> It is the call to exit, _Exit/_exit, or quick_exit which decides
> the sequence of process termination actions.

Well yes, in your implementation of the compat symbol.  But it doesn't 
has to be this way, and it may not be the “correct” approach.

> Particularly in C++ the quick_exit call must not run destructors
> for thread local objects, since the standard mandates that.
>
> Changing __cxa_thread_atexit_impl would be more complicated than
> just changing quick_exit.

I put “correct” in scare quotes because I'm not convinced that we'd need 
a compat symbol at all for this (but if we do, it probably should be put 
on the registration, storing a flag along with callback registration data).

Florian



More information about the Libc-alpha mailing list