[ Date Prev][ Date Next][ Thread Prev][ Thread Next][ Date Index][ Thread Index]
Re: [cxx-abi-dev] One-time Construction API (3.3.2)
- To: jason@xxxxxxxxxx
- Subject: Re: [cxx-abi-dev] One-time Construction API (3.3.2)
- From: Dennis Handly <dhandly@xxxxxxxxxx>
- Date: Fri, 6 Aug 2004 02:14:42 -0700 (PDT)
>From: Jason Merrill <jason@xxxxxxxxxx>
>> we seem to do the same for both. And it is left on the atexit list
>> for the latter.
>Doing the same for both is wrong, I think; once construction of the object
>is complete, it's complete, whether or not the subsequent cleanup throws.
I guess we could reduce the size of the catch to not include the cleanup.
>> try {
>> /* initialize */
>> __cxa_atexit(dtor);
>> __cxa_guard_release(&guard);
>> }
>> catch(...) {
>> __cxa_guard_abort(&guard);
>> }
>Yes, here it looks like you incorrectly call abort rather than release if a
>cleanup throws.
I suppose we can use gotos or a flag so that __cxa_guard_abort is skipped.
There really should be a rethrow in the catch block.
catch(...) {
__cxa_guard_abort(&guard);
throw;
}
// cleanup temps
>> We do use the second byte to handle (stop) recursion.
>I'm not sure what you mean. If you already have a mutex, what are you
>using the second byte for?
Jason
In undefined case where the code to initialize the function scope static
recursively calls the current function.
(Note the single mutex is recursive to handle the defined case of multiple
function scope statics being used.)
|