8264572: ForkJoinPool.getCommonPoolParallelism() reports always 1

Reviewed-by: alanb
This commit is contained in:
Doug Lea 2021-04-02 22:44:20 +00:00
parent 9c283da175
commit cec66cf8ef

@ -2572,6 +2572,7 @@ public class ForkJoinPool extends AbstractExecutorService {
this.saturate = null;
this.workerNamePrefix = null;
int p = Math.min(Math.max(parallelism, 0), MAX_CAP), size;
this.mode = p;
if (p > 0) {
size = 1 << (33 - Integer.numberOfLeadingZeros(p - 1));
this.bounds = ((1 - p) & SMASK) | (COMMON_MAX_SPARES << SWIDTH);