[c++-pthreads] Re: pthread_cancel and EH: let's try this again

Wil Evers wil at bogo.xs4all.nl
Tue Jul 19 04:49:26 UTC 2005


Alexander Terekhov wrote:
> Wil Evers wrote:
> [...]
> 
>>X::~X()
>>{
>>        try {
>>                cancellation_manager enabler(true);
>>                some_blocking_operation();
>>        } catch (const cancellation & ex) {
>>                // log ex
>>                // don't rethrow
>>        }
>>}
> 
> 
> Nope. It will break X's client logic relying on modularity of X in the 
> sense of its capability to defer cancellation and perform cancelable
> effects (subject any other failure modes, if any) when cancellation is 
> been disabled by X's client.

You've lost me.  Maybe you're assuming that a cancellation request will 
only cause a single cancellation exeception, in other words, that 
cancellation is not "sticky"?

- Wil




More information about the c++-pthreads mailing list