On Thu, 20 Nov 2025 15:21:36 GMT, Viktor Klang <[email protected]> wrote:
>> Doug Lea has updated the pull request incrementally with one additional
>> commit since the last revision:
>>
>> Tweaks
>
> src/java.base/share/classes/java/util/concurrent/ForkJoinPool.java line 1261:
>
>> 1259: if ((a = array) != null && (cap = a.length) > 0) { // else
>> disabled
>> 1260: int k = (m = cap - 1) & s;
>> 1261: if ((room = m - (s - b)) >= 0) {
>
> Not that I think it'd make much of a difference, but it would be possible to
> do the following:
>
> Suggestion:
>
> int k;
> if ((room = (k = (m = cap - 1) & s) - (s - b)) >= 0) {
Yes, but no: javac doesn't understand that the use of k in signalWork isn't
reached, so it seems better to just assign it anyway (an optimizer might figure
out when to avoid it .)
-------------
PR Review Comment: https://git.openjdk.org/jdk/pull/26479#discussion_r2557168322