do not startup commonPool accidentally

This commit is contained in:
Alexey Kudravtsev
2015-10-28 14:55:37 +03:00
parent b38c114ecc
commit 91d5d75923
@@ -288,7 +288,9 @@ public class JobLauncherImpl extends JobLauncher {
catch (CancellationException e) {
// was canceled in the middle of execution
// can't do anything but wait. help other tasks in the meantime
pool.awaitQuiescence(millis, TimeUnit.MILLISECONDS);
if (Thread.currentThread() instanceof ForkJoinWorkerThread) { // if called outside FJP the FJTask.fork() starts up commonPool which is undesirable
pool.awaitQuiescence(millis, TimeUnit.MILLISECONDS);
}
}
}
}