On Fri, 18 Oct 2024 12:27:34 GMT, Doug Lea <d...@openjdk.org> wrote: >> src/java.base/share/classes/java/util/concurrent/ForkJoinPool.java line 1913: >> >>> 1911: if (!all) >>> 1912: break; >>> 1913: } >> >> Stylistically, it might be cleaner to do this: >> >> Suggestion: >> >> do { >> WorkQueue[] qs; WorkQueue v; int sp, i; >> if ((sp = (int)c) == 0 || (qs = queues) == null || >> qs.length <= (i = sp & SMASK) || (v = qs[i]) == null) >> break; >> if (c == (c = compareAndExchangeCtl( >> c, ((UMASK & (c + RC_UNIT)) | (c & TC_MASK) | >> (v.stackPred & LMASK))))) { >> v.phase = sp; >> if (v.parking != 0) >> U.unpark(v.owner); >> } while(all); > > Yeah, except not quite that way, since the break should occur only if the CAS > succeeds. I'll try other options.
Ah, I see what you mean, I must've inferred a closing brace before. ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/21507#discussion_r1806415929