Re: [c++-pthreads] Re: thread-safety definition
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [c++-pthreads] Re: thread-safety definition



Alexander Terekhov wrote:
> 
> Dave Butenhof wrote:
> [...]
> > While I didn't have anything specific in mind, just a general concern,
> > one example that occurs to me is "catch(...) {...; throw;}". One must be
> > careful about specifying the "cancelled" state of the thread here; it
> > shouldn't be possible to consider the exception destroyed during the
> > body of the catch prior to the re-throw. I don't know if the current
> > wording in the standard would allow this interpretation: ....
> 
> That's 15.1/6 and 15.1/7 (no changes in TC1-2003 edition, AFAIK).
                            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

> 
> 6 A throw-expression with no operand rethrows the exception being
>   handled. The exception is reactivated with the existing temporary;
>   no new temporary exception object is created. The exception is no
>   longer considered to be caught; therefore, the value of
>   uncaught_exception() will again be true. [Example: code that must
    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

That's not necessarily true (it depends), BTW.


>   be executed because of an exception yet cannot completely handle
>   the exception can be written like this:
> 
>         try {
>                 // ...
>         }
>         catch (...) {           // catch all exceptions
> 
>                 // respond (partially) to exception
> 
>                 throw;          // pass the exception to some
>                                 // other handler
>         }
> 
>   ?end example]

http://groups.google.com/groups?selm=3D75E040.469A103E%40web.de

regards,
alexander.