29 |
|
static class DirectExecutorService extends AbstractExecutorService { |
30 |
|
public void execute(Runnable r) { r.run(); } |
31 |
|
public void shutdown() { shutdown = true; } |
32 |
< |
public List<Runnable> shutdownNow() { shutdown = true; return Collections.EMPTY_LIST; } |
32 |
> |
public List<Runnable> shutdownNow() { |
33 |
> |
shutdown = true; |
34 |
> |
return Collections.EMPTY_LIST; |
35 |
> |
} |
36 |
|
public boolean isShutdown() { return shutdown; } |
37 |
|
public boolean isTerminated() { return isShutdown(); } |
38 |
< |
public boolean awaitTermination(long timeout, TimeUnit unit) { return isShutdown(); } |
38 |
> |
public boolean awaitTermination(long timeout, TimeUnit unit) { |
39 |
> |
return isShutdown(); |
40 |
> |
} |
41 |
|
private volatile boolean shutdown = false; |
42 |
|
} |
43 |
|
|
248 |
|
} |
249 |
|
|
250 |
|
/** |
251 |
< |
* get of submitted callable throws InterruptedException if callable |
252 |
< |
* interrupted |
251 |
> |
* get of submitted callable throws InterruptedException if callable |
252 |
> |
* interrupted |
253 |
|
*/ |
254 |
|
public void testSubmitIE() throws InterruptedException { |
255 |
|
final ThreadPoolExecutor p = |
270 |
|
} |
271 |
|
|
272 |
|
/** |
273 |
< |
* get of submit(callable) throws ExecutionException if callable |
274 |
< |
* throws exception |
273 |
> |
* get of submit(callable) throws ExecutionException if callable |
274 |
> |
* throws exception |
275 |
|
*/ |
276 |
|
public void testSubmitEE() throws InterruptedException { |
277 |
|
ThreadPoolExecutor p = |