--- jsr166/src/test/tck/JSR166TestCase.java 2016/05/22 01:09:21 1.192 +++ jsr166/src/test/tck/JSR166TestCase.java 2016/05/23 18:42:17 1.194 @@ -12,6 +12,7 @@ * @modules java.management * @build * * @run junit/othervm/timeout=1000 -Djsr166.testImplementationDetails=true JSR166TestCase + * @run junit/othervm/timeout=1000 -Djava.util.concurrent.ForkJoinPool.common.parallelism=0 -Djsr166.testImplementationDetails=true JSR166TestCase */ import static java.util.concurrent.TimeUnit.MILLISECONDS; @@ -58,6 +59,7 @@ import java.util.concurrent.RecursiveAct import java.util.concurrent.RecursiveTask; import java.util.concurrent.RejectedExecutionHandler; import java.util.concurrent.Semaphore; +import java.util.concurrent.SynchronousQueue; import java.util.concurrent.ThreadFactory; import java.util.concurrent.ThreadPoolExecutor; import java.util.concurrent.TimeoutException; @@ -1841,4 +1843,11 @@ public class JSR166TestCase extends Test public Runnable runnableThrowing(final RuntimeException ex) { return new Runnable() { public void run() { throw ex; }}; } + + /** A reusable thread pool to be shared by tests. */ + static final ExecutorService cachedThreadPool = + new ThreadPoolExecutor(0, Integer.MAX_VALUE, + 1000L, MILLISECONDS, + new SynchronousQueue()); + }