58 |
|
import java.util.concurrent.RecursiveTask; |
59 |
|
import java.util.concurrent.RejectedExecutionHandler; |
60 |
|
import java.util.concurrent.Semaphore; |
61 |
+ |
import java.util.concurrent.SynchronousQueue; |
62 |
|
import java.util.concurrent.ThreadFactory; |
63 |
|
import java.util.concurrent.ThreadPoolExecutor; |
64 |
|
import java.util.concurrent.TimeoutException; |
520 |
|
// Java9+ test classes |
521 |
|
if (atLeastJava9()) { |
522 |
|
String[] java9TestClassNames = { |
523 |
< |
// Currently empty, but expecting varhandle tests |
523 |
> |
"ExecutorCompletionService9Test", |
524 |
|
}; |
525 |
|
addNamedTestClasses(suite, java9TestClassNames); |
526 |
|
} |
1842 |
|
public Runnable runnableThrowing(final RuntimeException ex) { |
1843 |
|
return new Runnable() { public void run() { throw ex; }}; |
1844 |
|
} |
1845 |
+ |
|
1846 |
+ |
/** A reusable thread pool to be shared by tests. */ |
1847 |
+ |
static final ExecutorService cachedThreadPool = |
1848 |
+ |
new ThreadPoolExecutor(0, Integer.MAX_VALUE, |
1849 |
+ |
1000L, MILLISECONDS, |
1850 |
+ |
new SynchronousQueue<Runnable>()); |
1851 |
+ |
|
1852 |
|
} |