
2013/1/14 Oliver Kowalke <oliver.kowalke@gmail.com>
void fn1( boost::barrier * b) { b->wait(); boost::this_thread::interruption_point(); }
void fn2( boost::thread * t1, boost::barrier * b, bool * interrupted) { t1->interrupt(); b->wait(); try { t1->join(); } catch ( boost::thread_interrupted const&) { * interrupted = true; } }
some correction -> replace void fn1( boost::barrier * b) { b->wait(); boost::xtime xt; boost::xtime_get(&xt, boost::TIME_UTC_); xt.sec += 1; //1 second boost::this_thread::sleep( xt); boost::this_thread::interruption_point(); } void fn2( boost::thread * t1, boost::barrier * b, bool * interrupted) { b->wait(); t1->interrupt(); try { t1->join(); } catch ( boost::thread_interrupted const&) { * interrupted = true; } } thread_interrupted is not catched