<!DOCTYPE html><html><head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
</head>
<body>
On 07/04/2025 22:36, Sergii Chekotylo wrote:<br>
<blockquote type="cite" cite="mid:BDC492F3-A17F-42AE-AD17-6F516734A758@gmail.com">
<pre class="moz-quote-pre" wrap="">Thank you for response Alan.
I have another question about closing the scope (exiting try-with-resources):
>From the code in the fork() method I’ve realized that methods join()/joinUntil() not intended to be called only once inside the single scope instance. And it is aligned with my use case. But what to do with TimeoutException? Of course I can wrap joinUntil in separate try-Catch, but how to interrupt all unfinished tasks without closing the scope?
Or maybe I just wrong about usage of the scope and it is intended to be used only once?
</pre>
</blockquote>
The intention is that there is only one "fork phase" so no forking
after join. The current API/implementation allows several phases,
the updated API that has been proposed fixes that issue.<br>
<br>
For your use-case then might want to use the shutdown method as it
will shut down the task scope (this interrupts the threads executing
all unfinished tasks) without closing the scope.<br>
<br>
-Alan<br>
</body>
</html>