<!DOCTYPE html><html><head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
  </head>
  <body>
    <div class="moz-cite-prefix">On 25/09/2025 06:38, <a class="moz-txt-link-abbreviated" href="mailto:forax@univ-mlv.fr">forax@univ-mlv.fr</a>
      wrote:<br>
    </div>
    <blockquote type="cite" cite="mid:97404974.36078828.1758778721689.JavaMail.zimbra@univ-eiffel.fr">
      
      <div style="font-family: arial, helvetica, sans-serif; font-size: 12pt; color: #000000">
        <div data-marker="__QUOTED_TEXT__">
          <div>:<br>
          </div>
          <div><br data-mce-bogus="1">
          </div>
          <div>The problem, is that this check is a kind of weak,
            because you can write</div>
          <div><br>
          </div>
          <div>
            <div>try(var sts = STS.open()) {</div>
            <div>    var subtask = sts.fork(callable); </div>
            <div><br data-mce-bogus="1">
            </div>
            <div>   // spurious STS are back !</div>
            <div>   Thread.ofVirtual().start(() ->
              IO.println(subtask.get())).join();</div>
            <div><br data-mce-bogus="1">
            </div>
            <div>    sts.join();</div>
            <div>  }</div>
          </div>
          <br>
        </div>
      </div>
    </blockquote>
    <br>
    It's only interesting to call Subtask::get in the main task (after
    join) or in a custom Joiner's onComplete when the thread that
    executed the subtask completes. The specified seat belt is to avoid
    a mistake in the main task where code might attempt to get the
    result before joining. It would of course feasible to specify it be
    not allowed from other random threads that happen to get a reference
    to the subtask, but it would add overhead to cater for a very
    off-piste usage.<br>
    <br>
    -Alan<br>
  </body>
</html>