115 |
|
* Upon any error in establishing these settings, default parameters |
116 |
|
* are used. It is possible to disable or limit the use of threads in |
117 |
|
* the common pool by setting the parallelism property to zero, and/or |
118 |
< |
* using a factory that may return {@code null}. |
118 |
> |
* using a factory that may return {@code null}. However doing so may |
119 |
> |
* cause unjoined tasks to never be executed. |
120 |
|
* |
121 |
|
* <p><b>Implementation notes</b>: This implementation restricts the |
122 |
|
* maximum number of running threads to 32767. Attempts to create |
1126 |
|
* Increment for seed generators. See class ThreadLocal for |
1127 |
|
* explanation. |
1128 |
|
*/ |
1129 |
< |
private static final int SEED_INCREMENT = 0x61c88647; |
1129 |
> |
private static final int SEED_INCREMENT = 0x9e3779b9; |
1130 |
|
|
1131 |
|
/* |
1132 |
|
* Bits and masks for control variables |
3275 |
|
} |
3276 |
|
|
3277 |
|
if (parallelism < 0 && // default 1 less than #cores |
3278 |
< |
(parallelism = Runtime.getRuntime().availableProcessors() - 1) < 0) |
3279 |
< |
parallelism = 0; |
3278 |
> |
(parallelism = Runtime.getRuntime().availableProcessors() - 1) <= 0) |
3279 |
> |
parallelism = 1; |
3280 |
|
if (parallelism > MAX_CAP) |
3281 |
|
parallelism = MAX_CAP; |
3282 |
|
return new ForkJoinPool(parallelism, factory, handler, LIFO_QUEUE, |