< prev index next >

src/java.base/share/classes/java/util/concurrent/ForkJoinPool.java

Print this page

        

*** 48,57 **** --- 48,58 ---- import java.util.Collection; import java.util.Collections; import java.util.List; import java.util.function.Predicate; import java.util.concurrent.locks.LockSupport; + import jdk.internal.misc.Strands; /** * An {@link ExecutorService} for running {@link ForkJoinTask}s. * A {@code ForkJoinPool} provides the entry point for submissions * from non-{@code ForkJoinTask} clients, as well as management and
*** 1920,1930 **** */ private <T> ForkJoinTask<T> externalSubmit(ForkJoinTask<T> task) { Thread t; ForkJoinWorkerThread w; WorkQueue q; if (task == null) throw new NullPointerException(); ! if (((t = Thread.currentThread()) instanceof ForkJoinWorkerThread) && (w = (ForkJoinWorkerThread)t).pool == this && (q = w.workQueue) != null) q.push(task); else externalPush(task); --- 1921,1931 ---- */ private <T> ForkJoinTask<T> externalSubmit(ForkJoinTask<T> task) { Thread t; ForkJoinWorkerThread w; WorkQueue q; if (task == null) throw new NullPointerException(); ! if (((t = Strands.currentCarrierThread()) instanceof ForkJoinWorkerThread) && (w = (ForkJoinWorkerThread)t).pool == this && (q = w.workQueue) != null) q.push(task); else externalPush(task);
*** 3113,3123 **** throws InterruptedException { if (blocker == null) throw new NullPointerException(); ForkJoinPool p; ForkJoinWorkerThread wt; WorkQueue w; ! Thread t = Thread.currentThread(); if ((t instanceof ForkJoinWorkerThread) && (p = (wt = (ForkJoinWorkerThread)t).pool) != null && (w = wt.workQueue) != null) { int block; while (!blocker.isReleasable()) { --- 3114,3124 ---- throws InterruptedException { if (blocker == null) throw new NullPointerException(); ForkJoinPool p; ForkJoinWorkerThread wt; WorkQueue w; ! Thread t = Strands.currentCarrierThread(); if ((t instanceof ForkJoinWorkerThread) && (p = (wt = (ForkJoinWorkerThread)t).pool) != null && (w = wt.workQueue) != null) { int block; while (!blocker.isReleasable()) {
< prev index next >