Boost logo

Boost :

Subject: Re: [boost] [boost thread] Catching interrupted exception?
From: Philip Bennefall (philip_at_[hidden])
Date: 2013-07-31 16:54:00

----- Original Message -----
From: "Rob Stewart" <robertstewart_at_[hidden]>
To: <boost_at_[hidden]>
Sent: Wednesday, July 31, 2013 10:47 PM
Subject: Re: [boost] [boost thread] Catching interrupted exception?

On Jul 31, 2013, at 4:32 PM, Philip Bennefall <philip_at_[hidden]> wrote:

> I am making fairly heavy use of the interrupt method call of the thread
> class, and I am wondering whether I should be catching the
> boost::thread_interrupted exception from within my thread function? I
> currently do not and my program runs fine, but I am wondering whether this
> is defined behavior or whether I should always be catching the exception
> and returning from the function inside the handler?

If you don't need to react to the interruption, what you're doing is just

Thanks, Rob. I just want to terminate the thread as soon as possible so the
behavior I am seeing is what I expect and wish for; I just wanted to make
sure it was defined behavior and not just some implementation detail.

Kind regards,

Philip Bennefall

Boost list run by bdawes at, gregod at, cpdaniel at, john at