1 |
|
/* |
2 |
|
* Written by Doug Lea with assistance from members of JCP JSR-166 |
3 |
|
* Expert Group and released to the public domain, as explained at |
4 |
< |
* http://creativecommons.org/licenses/publicdomain |
4 |
> |
* http://creativecommons.org/publicdomain/zero/1.0/ |
5 |
|
* Other contributors include Andrew Wright, Jeffrey Hayes, |
6 |
|
* Pat Fisher, Mike Judd. |
7 |
|
*/ |
406 |
|
try { |
407 |
|
p.execute(new CheckedRunnable() { |
408 |
|
public void realRun() throws InterruptedException { |
409 |
– |
threadStarted.countDown(); |
409 |
|
assertFalse(p.isTerminated()); |
410 |
+ |
threadStarted.countDown(); |
411 |
|
done.await(); |
412 |
|
}}); |
413 |
|
assertTrue(threadStarted.await(SMALL_DELAY_MS, MILLISECONDS)); |
414 |
+ |
assertFalse(p.isTerminating()); |
415 |
|
done.countDown(); |
416 |
|
} finally { |
417 |
|
try { p.shutdown(); } catch (SecurityException ok) { return; } |
434 |
|
assertFalse(p.isTerminating()); |
435 |
|
p.execute(new CheckedRunnable() { |
436 |
|
public void realRun() throws InterruptedException { |
436 |
– |
threadStarted.countDown(); |
437 |
|
assertFalse(p.isTerminating()); |
438 |
+ |
threadStarted.countDown(); |
439 |
|
done.await(); |
440 |
|
}}); |
441 |
|
assertTrue(threadStarted.await(SMALL_DELAY_MS, MILLISECONDS)); |