[cpp-threads] Thread API interface tweaks

Alexander Terekhov alexander.terekhov at gmail.com
Tue Aug 29 12:59:43 BST 2006


On 8/29/06, Peter Dimov <pdimov at mmltd.net> wrote:
[...]
> The current design treats a cancellation exception no different than any
> other exception; that is, operator() throws a cancellation exception when
> the thread executing the task has been cancelled.
>
> This introduces an ambiguity since operator() can block and be itself
> cancelled. That's why there is an explicit wait(); when it throws, the
> waiting thread has been cancelled. After a successful wait(), if operator()
> throws a cancellation exception, it has come from the other side.

And this introduces an ambiguity race. No? What about try_wait()? Does it
throw cancel or not?

regards,
alexander.



More information about the cpp-threads mailing list