708 |
|
* shared-queue version is embedded in method externalPush.) |
709 |
|
* |
710 |
|
* @param task the task. Caller must ensure non-null. |
711 |
< |
* @throw RejectedExecutionException if array cannot be resized |
711 |
> |
* @throws RejectedExecutionException if array cannot be resized |
712 |
|
*/ |
713 |
|
final void push(ForkJoinTask<?> task) { |
714 |
|
ForkJoinTask<?>[] a; ForkJoinPool p; |
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; |
1244 |
|
volatile Object pad10, pad11, pad12, pad13, pad14, pad15, pad16, pad17; |
1245 |
|
volatile Object pad18, pad19, pad1a, pad1b; |
1246 |
|
|
1247 |
< |
/* |
1247 |
> |
/** |
1248 |
|
* Acquires the plock lock to protect worker array and related |
1249 |
|
* updates. This method is called only if an initial CAS on plock |
1250 |
|
* fails. This acts as a spinlock for normal cases, but falls back |
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 |
|
|
2691 |
|
try { |
2692 |
|
for (Callable<T> t : tasks) { |
2693 |
|
ForkJoinTask<T> f = new ForkJoinTask.AdaptedCallable<T>(t); |
2694 |
– |
externalPush(f); |
2694 |
|
futures.add(f); |
2695 |
+ |
externalPush(f); |
2696 |
|
} |
2697 |
|
for (int i = 0, size = futures.size(); i < size; i++) |
2698 |
|
((ForkJoinTask<?>)futures.get(i)).quietlyJoin(); |
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); |