--- jsr166/src/jsr166e/ForkJoinPool.java 2013/01/22 23:00:06 1.48 +++ jsr166/src/jsr166e/ForkJoinPool.java 2013/02/05 17:26:53 1.54 @@ -708,7 +708,7 @@ public class ForkJoinPool extends Abstra * shared-queue version is embedded in method externalPush.) * * @param task the task. Caller must ensure non-null. - * @throw RejectedExecutionException if array cannot be resized + * @throws RejectedExecutionException if array cannot be resized */ final void push(ForkJoinTask task) { ForkJoinTask[] a; ForkJoinPool p; @@ -952,7 +952,7 @@ public class ForkJoinPool extends Abstra /** * Polls for and executes the given task or any other task in - * its CountedCompleter computation + * its CountedCompleter computation. */ final boolean pollAndExecCC(ForkJoinTask root) { ForkJoinTask[] a; int b; Object o; @@ -1244,7 +1244,7 @@ public class ForkJoinPool extends Abstra volatile Object pad10, pad11, pad12, pad13, pad14, pad15, pad16, pad17; volatile Object pad18, pad19, pad1a, pad1b; - /* + /** * Acquires the plock lock to protect worker array and related * updates. This method is called only if an initial CAS on plock * fails. This acts as a spinlock for normal cases, but falls back @@ -2466,7 +2466,7 @@ public class ForkJoinPool extends Abstra * java.lang.RuntimePermission}{@code ("modifyThread")} */ public ForkJoinPool() { - this(Runtime.getRuntime().availableProcessors(), + this(Math.min(MAX_CAP, Runtime.getRuntime().availableProcessors()), defaultForkJoinWorkerThreadFactory, null, false); } @@ -2691,8 +2691,8 @@ public class ForkJoinPool extends Abstra try { for (Callable t : tasks) { ForkJoinTask f = new ForkJoinTask.AdaptedCallable(t); - externalPush(f); futures.add(f); + externalPush(f); } for (int i = 0, size = futures.size(); i < size; i++) ((ForkJoinTask)futures.get(i)).quietlyJoin(); @@ -3166,7 +3166,7 @@ public class ForkJoinPool extends Abstra /** * Waits and/or attempts to assist performing tasks indefinitely - * until the {@link #commonPool()} {@link #isQuiescent} + * until the {@link #commonPool()} {@link #isQuiescent}. */ static void quiesceCommonPool() { common.awaitQuiescence(Long.MAX_VALUE, TimeUnit.NANOSECONDS);