
6 Aug
2010
6 Aug
'10
1:55 p.m.
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 ? Regards Gaetano Mendola