7 |
|
*/ |
8 |
|
|
9 |
|
import junit.framework.*; |
10 |
< |
import java.util.concurrent.*; |
10 |
> |
import java.util.concurrent.Callable; |
11 |
> |
import java.util.concurrent.CancellationException; |
12 |
> |
import java.util.concurrent.CountDownLatch; |
13 |
> |
import java.util.concurrent.ExecutionException; |
14 |
> |
import java.util.concurrent.Future; |
15 |
> |
import java.util.concurrent.FutureTask; |
16 |
> |
import java.util.concurrent.TimeoutException; |
17 |
|
import static java.util.concurrent.TimeUnit.MILLISECONDS; |
18 |
|
import static java.util.concurrent.TimeUnit.SECONDS; |
19 |
|
import java.util.*; |
372 |
|
new FutureTask(new CheckedInterruptedCallable<Object>() { |
373 |
|
public Object realCall() throws InterruptedException { |
374 |
|
threadStarted.countDown(); |
375 |
< |
Thread.sleep(LONG_DELAY_MS); |
375 |
> |
delay(LONG_DELAY_MS); |
376 |
|
return Boolean.TRUE; |
377 |
|
}}); |
378 |
|
|
401 |
|
new FutureTask(new CheckedInterruptedCallable<Object>() { |
402 |
|
public Object realCall() throws InterruptedException { |
403 |
|
threadStarted.countDown(); |
404 |
< |
Thread.sleep(LONG_DELAY_MS); |
404 |
> |
delay(LONG_DELAY_MS); |
405 |
|
return Boolean.TRUE; |
406 |
|
}}); |
407 |
|
|