Re: pthread_cancel and EH: let's try this again
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: pthread_cancel and EH: let's try this again
- To: c++-pthreads@xxxxxxxxxxxxxxxx
- Subject: Re: pthread_cancel and EH: let's try this again
- From: Alexander Terekhov <terekhov@xxxxxx>
- Date: Wed, 27 Jul 2005 22:44:20 +0200
Peter Dimov wrote:
[...]
> > With cancel request pending, mandatory cancel points are required to
> > throw within a cleanup handler invoked by pthread_cleanup_pop() ["(if
> > /execute/ is non-zero)"] when cancel state is PTHREAD_CANCEL_ENABLE.
>
> An odd requirement that could've been given the appropriate attention had
> something like the above been proposed. ;-)
>
> The specification of the hypothetical pthread_cancelenabled can be "fixed"
> to match this behavior, but I'm not sure that this is desirable. If you have
> two calls to 'close' in the cleanup handler and the first is canceled, the
> second will be skipped.
Yep. So you either disable cancel in such a cleanup handler that can
be invoked by pthread_cleanup_pop(), or move the second cancel point
to another pthread_cleanup_pop(1) handler inside the first one.
regards,
alexander.