A shutdown task can still succeed ?
Alan Bateman
Alan.Bateman at oracle.com
Tue Feb 8 16:20:26 UTC 2022
On 08/02/2022 15:55, forax at univ-mlv.fr wrote:
> :
> I think i would prefer something like cancelOtherTasks() or stopOtherTasks() than shutdown() because it is what shutdown does, it stops the completion of the other tasks.
It's a bit more than that. As Ron said, it is more like the "the scope
computation is done". It interrupts unfinished threads and prevents new
threads from starting. It also causes join to wakeup as the main task
has no reason to wait any longer. In general I think it would be an
advanced usage to call shutdown from a task. It is clearer to call
shutdown from the handler method, after the task with the result has
completed.
-Alan.
More information about the loom-dev
mailing list