changeset 7832:2fd5a66fed96

Small performance tweak to AbstractTask Contributed-by: dl@cs.oswego.edu
author briangoetz
date Sun, 07 Apr 2013 18:26:04 -0400
parents 52923cc16dc4
children 2eafb34235ba
files src/share/classes/java/util/stream/AbstractTask.java
diffstat 1 files changed, 2 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/src/share/classes/java/util/stream/AbstractTask.java	Fri Apr 05 19:04:04 2013 -0400
+++ b/src/share/classes/java/util/stream/AbstractTask.java	Sun Apr 07 18:26:04 2013 -0400
@@ -271,6 +271,7 @@
      */
     @Override
     public final void compute() {
+        ForkJoinPool cp = ForkJoinPool.commonPool();
         @SuppressWarnings("unchecked")
         T task = (T) this;
         while (task.canCompute()) {
@@ -286,7 +287,7 @@
                 task.children = leftChild;
                 leftChild.nextSibling = rightChild;
                 task.setPendingCount(1);
-                leftChild.fork();
+                cp.execute(leftChild);
                 task = rightChild;
             }
         }