From: Peter Dimov (pdimov_at_[hidden])
Date: 2007-11-02 12:23:09


Anthony Williams:

> As I understand it, with gcc on linux, pthread_cancel will run destructors
> and
> catch(...) blocks in the cancelled thread, but if the catch(...) block
> doesn't
> rethrow the exception, it is automatically rethrown at the end of the
> block

No, NPTL calls abort() if the catch block ends without a rethrow. There is a
patch (by Jason Mitchell, I believe) that makes it not do that. There is no
technical reason to make NPTL cancel appear to C++ code as an ordinary C++
exception, it's politics. Even so, NPTL is much, much better than any of the
alternatives (except maybe OpenVMS where cancelation is an OS "structured
exception").