|
Boost : |
Subject: Re: [boost] [1.44] Beta progress?
From: Dmitry Goncharov (dgoncharov_at_[hidden])
Date: 2010-08-06 10:24:56
> -----Original Message-----
> From: boost-bounces_at_[hidden] [mailto:boost-
> bounces_at_[hidden]] On Behalf Of Anthony Williams
> Sent: Friday, August 06, 2010 6:16 PM
> To: Gaetano Mendola
> Cc: boost_at_[hidden]
> Subject: Re: [boost] [1.44] Beta progress?
>
> On 06/08/10 14:55, Gaetano Mendola wrote:
> > On 07/26/2010 10:11 PM, Anthony Williams wrote:
> >> However, in practice it is not. I am not aware of any platforms where
> >> I can cleanly catch a cancellation from pthread_cancel and translate
> >> it into a boost::thread_interrupted exception. If I figure out a way,
> >> I'll gladly use it.
> >
> > Since gcc4.3 (?) it's possible to do this:
> >
> > #include<cxxabi.h>
> >
> > try {
> > ...
> > ::pthread_mutex_lock(&mutex);
> > ::pthread_cond_wait (&condition,&mutex); } catch (
> > abi::__forced_unwind& ) {
> > std::cout<< "thread cancelled"<< std::endl;
> > throw boost::thread_interrupted;
> > }
> >
> > isn't this what you are looking for ?
>
> On my linux system that aborts the program with "FATAL: exception not
> rethrown"
>
That is exactly what is supposed to happen. NPTL uses abi::__forced_unwind for cancellation and it has to be rethrown.
Regards, Dmitry
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk