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; |
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 |
|
} |