|
Boost : |
From: Alexander Terekhov (terekhov_at_[hidden])
Date: 2002-08-27 05:39:21
Darryl Green wrote:
>
> I still don't get it. What exactly is the point you are trying to make? Are
> you suggesting that one should or shouldn't,
I'm suggesting that one shouldn't (no matter whether it can be done or not,
"conformance" aside for a moment).
> can or can't write a terminate
> handler that terminates the thread but not the process and is such a program
> conforming or not?
Well, let me put it this way: feel free to fool yourself into believing that
it's somehow going to make your application safer/robuster ("better"), using
the following {anti-}"pattern":
< illustration only; NOT "real" code, but it doesn't screw up terminate(),
"at least" >
extern "C" void* thread_routine_wrapper( void* arg )
{
try {
return call_something( arg );
}
catch( const pthread_cancel_e& ) { throw; }
catch( const pthread_exit_e& ) { throw; }
catch( ... ) {} // ignore
return "HI_THERE_COMMA_TAKE_THIS_UNCAUGHT_EXCEPTION";
}
regards,
alexander.
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk