Subj : Re: pthread function behavior in C++ program To : comp.programming.threads From : Alexander Terekhov Date : Sun Jun 12 2005 10:02 pm Peter Dimov wrote: > > Torsten Robitzki wrote: > >> It's better because it's only one step from the "right thing". They > >> only need to re-cancel (not rethrow!) instead of terminating. There is no need for that (legacy thread cancel/exit unaware stuff with catch(...) aside for a moment), given that it can be done by application programmer. > >> Not running destructors and exception handlers will "only" leak and > >> deadlock, but such an implementation would be much more difficult to > >> fix. > > > > What do you have in mind when you distinct between "re-cancel" and > > "rethrow"? > > If you have > > void f() throw() > { > try { cancellation_point(); } catch(...) {} try { cancellation_point(); } catch(std::thread_cancel_request const &) { re-enable cancel re-cancel self } } regards, alexander. .