12 |
|
* @modules java.management |
13 |
|
* @build * |
14 |
|
* @run junit/othervm/timeout=1000 -Djsr166.testImplementationDetails=true JSR166TestCase |
15 |
+ |
* @run junit/othervm/timeout=1000 -Djava.util.concurrent.ForkJoinPool.common.parallelism=0 -Djsr166.testImplementationDetails=true JSR166TestCase |
16 |
|
*/ |
17 |
|
|
18 |
|
import static java.util.concurrent.TimeUnit.MILLISECONDS; |
59 |
|
import java.util.concurrent.RecursiveTask; |
60 |
|
import java.util.concurrent.RejectedExecutionHandler; |
61 |
|
import java.util.concurrent.Semaphore; |
62 |
+ |
import java.util.concurrent.SynchronousQueue; |
63 |
|
import java.util.concurrent.ThreadFactory; |
64 |
|
import java.util.concurrent.ThreadPoolExecutor; |
65 |
|
import java.util.concurrent.TimeoutException; |
1843 |
|
public Runnable runnableThrowing(final RuntimeException ex) { |
1844 |
|
return new Runnable() { public void run() { throw ex; }}; |
1845 |
|
} |
1846 |
+ |
|
1847 |
+ |
/** A reusable thread pool to be shared by tests. */ |
1848 |
+ |
static final ExecutorService cachedThreadPool = |
1849 |
+ |
new ThreadPoolExecutor(0, Integer.MAX_VALUE, |
1850 |
+ |
1000L, MILLISECONDS, |
1851 |
+ |
new SynchronousQueue<Runnable>()); |
1852 |
+ |
|
1853 |
|
} |