On Fri, 12 Dec 2025 23:00:29 GMT, Viktor Klang <[email protected]> wrote:
>> src/java.base/share/classes/java/util/concurrent/ForkJoinPool.java line 1434:
>>
>>> 1432: final int topLevelExec(ForkJoinTask<?> task, WorkQueue q,
>>> 1433: int fifo, int qbase) {
>>> 1434: int stolen = 1;
>>
>> @DougLea It does seem a bit weird that stolen starts as 1 even if "task ==
>> null" (i.e. this method would return 1 for an invocation where task or q is
>> null, which doesn't sounds right?)
>
> On the other hand, `t` is never null, and `q` is never null, so I'll just
> suggest a small comment below.
Or less oddly, now prefaced with
if (task == null || q == null)
return 0; // currently impossible
I also added some javadoc and comments and cosmetics
-------------
PR Review Comment: https://git.openjdk.org/jdk/pull/28797#discussion_r2616349996