RFR: StructuredTaskScope Javadoc: consistently use the phrase "contained in the task scope" [v2]

Anthony Vanelverdinghe duke at openjdk.org
Sun Nov 13 15:15:59 UTC 2022


On Sun, 13 Nov 2022 14:36:40 GMT, Alan Bateman <alanb at openjdk.org> wrote:

>> Anthony Vanelverdinghe has updated the pull request incrementally with one additional commit since the last revision:
>> 
>>   Revert incorrect change
>
> src/jdk.incubator.concurrent/share/classes/jdk/incubator/concurrent/StructuredTaskScope.java line 629:
> 
>> 627:      * {@linkplain Future#get() waiting} on a result so that the waiting threads wakeup.
>> 628:      * <li> {@linkplain Thread#interrupt() Interrupts} all unfinished threads contained in the
>> 629:      * task scope.
> 
> The existing javadoc is correct. When you invoke scope.shutdown() it interrupts the unfinished threads in the task scope, it's just one level, not the tree. It might be that interrupting these threads leads to these threads invoking shutdown or close on other task scopes in the tree but that's an indirect effect that can't be specified here. Also, the reason it says "except the current thread" is because the shutdown method can be called from a thread started in the task scope and it would be confusing to interrupt self. So we shouldn't remove that from the javadoc.

Thanks for the clarification. I've reverted the incorrect change.

-------------

PR: https://git.openjdk.org/loom/pull/194


More information about the loom-dev mailing list