Boost logo

Boost :

Subject: Re: [boost] thread interruption request
From: Vicente J. Botet Escriba (vicente.botet_at_[hidden])
Date: 2016-04-17 16:04:49


Le 10/04/2016 16:24, Gaetano Mendola a écrit :
> Is there a way for an interruption point to not reset
> the interruption request flag before throwing?
>
> I have a Class accepting functions to be executed
> asynchronously this is implemented in terms of
> boost threads:
>
> T::operator()() {
> while (true) {
> foo();
> boost::this_thread::interruption_point();
> }
> }
>
> One of those functions performs some operations
> between a:
>
> try { /*code*/ } catch(...) { }
>
> this basically makes my Class not interruptible indeed
> that boost::this_thread::interruption_point() is useless
> if a boost::thread_interrupted has been catched inside
> the foo.
>
> I have found this:
> http://lists.boost.org/boost-users/2008/08/39106.php
> where the guys needs a way to reset it, I need a way
> to leave the flag on for the entire thread life if
> an interruption has been requested.
Hi,

IIUC what you want is to interrupt the task not the threads, isn't it??

Vicente


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk