Re: [c++-pthreads] Re: cancellation points report failure
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [c++-pthreads] Re: cancellation points report failure



Fergus Henderson wrote:
[...]
> > Objection. To begin with, asynchronous cancelability IS part of
> > pthreads.
> 
> Asynchronous cancelability only works if you can be sure that there
> are no implicit calls to async-cancel-unsafe functions going on.

Yep (and probably also C++ things like throw-expressions and "try 
{").

> That's not too hard to ensure in C, but it's a lot more difficult
> in C++.

And that's why my previous message was meant to illustrate what 
I'd call "async-cancel correctness" -- an attempt to have async-
cancel-UNsafe operation inside async-cancel scope (async_cancel 
{ /*...*/ }) shall be flagged as compile-time error. A function 
declared async_cancel_safe is async-cancel-safe (implies async-
cancel-safety/correctness for its invocation [I mean "passing" 
parameter(s) and/or return value, if any] and its body).

regards,
alexander.