907 |
|
* or any other cancelled task. Returns (true) on any CAS |
908 |
|
* or consistency check failure so caller can retry. |
909 |
|
* |
910 |
< |
* @return false if no progress can be made, else true; |
910 |
> |
* @return false if no progress can be made, else true |
911 |
|
*/ |
912 |
|
final boolean tryRemoveAndExec(ForkJoinTask<?> task) { |
913 |
|
boolean stat = true, removed = false, empty = true; |
952 |
|
|
953 |
|
/** |
954 |
|
* Polls for and executes the given task or any other task in |
955 |
< |
* its CountedCompleter computation |
955 |
> |
* its CountedCompleter computation. |
956 |
|
*/ |
957 |
|
final boolean pollAndExecCC(ForkJoinTask<?> root) { |
958 |
|
ForkJoinTask<?>[] a; int b; Object o; |
2185 |
|
* producing extra tasks amortizes the uncertainty of progress and |
2186 |
|
* diffusion assumptions. |
2187 |
|
* |
2188 |
< |
* So, users will want to use values larger, but not much larger |
2188 |
> |
* So, users will want to use values larger (but not much larger) |
2189 |
|
* than 1 to both smooth over transient shortages and hedge |
2190 |
|
* against uneven progress; as traded off against the cost of |
2191 |
|
* extra task overhead. We leave the user to pick a threshold |
2466 |
|
* java.lang.RuntimePermission}{@code ("modifyThread")} |
2467 |
|
*/ |
2468 |
|
public ForkJoinPool() { |
2469 |
< |
this(Runtime.getRuntime().availableProcessors(), |
2469 |
> |
this(Math.min(MAX_CAP, Runtime.getRuntime().availableProcessors()), |
2470 |
|
defaultForkJoinWorkerThreadFactory, null, false); |
2471 |
|
} |
2472 |
|
|
3166 |
|
|
3167 |
|
/** |
3168 |
|
* Waits and/or attempts to assist performing tasks indefinitely |
3169 |
< |
* until the {@link #commonPool()} {@link #isQuiescent} |
3169 |
> |
* until the {@link #commonPool()} {@link #isQuiescent}. |
3170 |
|
*/ |
3171 |
|
static void quiesceCommonPool() { |
3172 |
|
common.awaitQuiescence(Long.MAX_VALUE, TimeUnit.NANOSECONDS); |