pthread_cancel and EH: let's try this again

Alexander Terekhov terekhov at web.de
Thu Jul 14 10:11:57 UTC 2005


Jason Merrill wrote:
> 
> On 13 Jul 2005 21:52:14 +0200, Gabriel Dos Reis <gdr at integrable-solutions.net> wrote:
> 
> > I think cancellation should be left as ordinary C++, catchable through
> > catch(...).  I don't think we should second guess client code and
> > design a new model of exception.
> 
> My point is that making it an exception is also second-guessing client
> code which is written to use the POSIX C binding.

Code conforming to POSIX won't notice it. Your client wants to have 
a totally brain-damaged POSIX C++ bindings with thread cancellation 
acting as a sorta abnormal exception that would either ignore 
catch(...){} and throw() and "unwind the stack correctly", or would 
"not bother to unwind the stack" apart from the stack of POSIX 
push/pop cleanup handlers -- "it should work as it did before". 

https://bugzilla.redhat.com/bugzilla/show_bug.cgi?id=111548

<quote>

If cancellation can't unwind the stack correctly while ignoring any 
throw() or catch(...){} code that would impede a normal exception, 
then it should work as it did before and not bother to unwind the 
stack.

</quote>

And that's only because you've refused to make cancellation act as 
a normal exception in C++ simply letting your client himself 
distinguish it from other exceptions that he really intended to be 
swallowed by his catch(...){}. That's my second-guess. ;-)

regards,
alexander.




More information about the c++-pthreads mailing list