90 |
|
final Runnable task = new CheckedRunnable() { |
91 |
|
public void realRun() { done.countDown(); }}; |
92 |
|
p.execute(task); |
93 |
< |
assertTrue(done.await(LONG_DELAY_MS, MILLISECONDS)); |
93 |
> |
await(done); |
94 |
|
} |
95 |
|
} |
96 |
|
|
184 |
|
public void realRun() throws InterruptedException { |
185 |
|
threadStarted.countDown(); |
186 |
|
assertEquals(0, p.getCompletedTaskCount()); |
187 |
< |
threadProceed.await(); |
187 |
> |
await(threadProceed); |
188 |
|
threadDone.countDown(); |
189 |
|
}}); |
190 |
|
await(threadStarted); |
191 |
|
assertEquals(0, p.getCompletedTaskCount()); |
192 |
|
threadProceed.countDown(); |
193 |
< |
threadDone.await(); |
193 |
> |
await(threadDone); |
194 |
|
long startTime = System.nanoTime(); |
195 |
|
while (p.getCompletedTaskCount() != 1) { |
196 |
|
if (millisElapsedSince(startTime) > LONG_DELAY_MS) |
1941 |
|
public void realRun() { |
1942 |
|
done.countDown(); |
1943 |
|
}}); |
1944 |
< |
assertTrue(done.await(LONG_DELAY_MS, MILLISECONDS)); |
1944 |
> |
await(done); |
1945 |
|
} |
1946 |
|
} |
1947 |
|
|
2034 |
|
} |
2035 |
|
} |
2036 |
|
// enough time to run all tasks |
2037 |
< |
assertTrue(done.await(nTasks * SHORT_DELAY_MS, MILLISECONDS)); |
2037 |
> |
await(done, nTasks * SHORT_DELAY_MS); |
2038 |
|
} |
2039 |
|
} |
2040 |
|
|