aboutsummaryrefslogtreecommitdiff
path: root/src/share/classes/java/util/concurrent
diff options
context:
space:
mode:
authordl <none@none>2013-08-15 15:01:37 +0100
committerdl <none@none>2013-08-15 15:01:37 +0100
commit5268ed6cd847d141147a6774f60234d1e44e930f (patch)
tree174d7d8da395f1476ab09021b0570e8abdb3365b /src/share/classes/java/util/concurrent
parent9d7030832c98c993cb0574d953e4ef88224ac407 (diff)
downloadjdk8u_jdk-5268ed6cd847d141147a6774f60234d1e44e930f.tar.gz
8023103: FJ parallelism zero
8020537: java/util/concurrent/forkjoin/ThrowingRunnable.java Reviewed-by: chegar, mduigou, alanb
Diffstat (limited to 'src/share/classes/java/util/concurrent')
-rw-r--r--src/share/classes/java/util/concurrent/ForkJoinPool.java7
1 files changed, 4 insertions, 3 deletions
diff --git a/src/share/classes/java/util/concurrent/ForkJoinPool.java b/src/share/classes/java/util/concurrent/ForkJoinPool.java
index 6db2d48c16..749f8b5736 100644
--- a/src/share/classes/java/util/concurrent/ForkJoinPool.java
+++ b/src/share/classes/java/util/concurrent/ForkJoinPool.java
@@ -144,7 +144,8 @@ import java.util.concurrent.TimeUnit;
* Upon any error in establishing these settings, default parameters
* are used. It is possible to disable or limit the use of threads in
* the common pool by setting the parallelism property to zero, and/or
- * using a factory that may return {@code null}.
+ * using a factory that may return {@code null}. However doing so may
+ * cause unjoined tasks to never be executed.
*
* <p><b>Implementation notes</b>: This implementation restricts the
* maximum number of running threads to 32767. Attempts to create
@@ -3303,8 +3304,8 @@ public class ForkJoinPool extends AbstractExecutorService {
}
if (parallelism < 0 && // default 1 less than #cores
- (parallelism = Runtime.getRuntime().availableProcessors() - 1) < 0)
- parallelism = 0;
+ (parallelism = Runtime.getRuntime().availableProcessors() - 1) <= 0)
+ parallelism = 1;
if (parallelism > MAX_CAP)
parallelism = MAX_CAP;
return new ForkJoinPool(parallelism, factory, handler, LIFO_QUEUE,