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

Mark Mitchell mark at codesourcery.com
Fri Jul 15 07:19:38 UTC 2005


Jakub Jelinek wrote:
> On Thu, Jul 14, 2005 at 05:24:57PM -0700, Mark Mitchell wrote:
> 
>>Why not just have two modes, controlled by an environment variable, 
>>link-time option, or run-time variable?  In the first mode, cancellation 
>>would not be an exception and nothing but pthread_cleanup_push'd code is 
>>run, and stack unwinding of all kinds is totally ignored.  In the second 
>>mode, cancellation would be an exception; nothing more, nothing less.
> 
> 
> There is big amount of code in Linux after a few past years that already
> has pthread_cleanup_{push,pop} internally implemented as a C++ object
> with a destructor.  So this is really not a workable option.

Really?

In that case, I think you're at impasse.

Skipping "catch (...)" really just doesn't make sense to most of us. 
But, your customer doesn't want catch clauses to be run.  So, if it's 
impossible to restore "classic" POSIX C semantics, then you're out of luck.

-- 
Mark Mitchell
CodeSourcery, LLC
mark at codesourcery.com
(916) 791-8304



More information about the c++-pthreads mailing list