Boost logo

Boost :

From: bill_kempf (williamkempf_at_[hidden])
Date: 2002-01-14 11:58:21


--- In boost_at_y..., Mac Murrett <mmurrett_at_v...> wrote:
> On 1/14/02 11:19 AM, "bill_kempf" <williamkempf_at_h...> wrote:
>
> > --- In boost_at_y..., Mac Murrett <mmurrett_at_v...> wrote:
> [snip]
> >> As an aside, I am in favor of Bill's approach, if we implement
> > cancellation
> >> at all. I would suggest making the exception a private member
type
> > of
> >> thread, so that it can only be caught by thread::thread_proxy.
> >
> > That won't work.
> >
> > try {
> > boost::mutex::scoped_lock lock(mutex);
> > }
> > catch (...) {
> > // I've caught the exception even though it's a private
> > // exception type
> > }
>
> I worded that poorly. The point is to document in code that these
> exceptions are not meant to be caught.
>
>
> > The best that Boost.Threads can do is insure that even if you
catch
> > the exception you can't "eat" it. This may still cause problems
with
> > some legacy code, but this isn't a good argument against such a
> > cancellation mechanism, IMHO.
>
> Out of curiosity, how can we do this?

The solution was posted on here some time ago. The general idea is
to have the exception's constructor do the re-throw, with a mechanism
for the thread proxy to disable this.

Bill Kempf


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