203 |
|
RunnableCounter counter = new RunnableCounter(); |
204 |
|
ScheduledFuture h = |
205 |
|
p.scheduleAtFixedRate(counter, 0, 1, MILLISECONDS); |
206 |
< |
Thread.sleep(SMALL_DELAY_MS); |
206 |
> |
delay(SMALL_DELAY_MS); |
207 |
|
h.cancel(true); |
208 |
|
int c = counter.count.get(); |
209 |
|
// By time scaling conventions, we must have at least |
221 |
|
RunnableCounter counter = new RunnableCounter(); |
222 |
|
ScheduledFuture h = |
223 |
|
p.scheduleWithFixedDelay(counter, 0, 1, MILLISECONDS); |
224 |
< |
Thread.sleep(SMALL_DELAY_MS); |
224 |
> |
delay(SMALL_DELAY_MS); |
225 |
|
h.cancel(true); |
226 |
|
int c = counter.count.get(); |
227 |
|
assertTrue(c >= SMALL_DELAY_MS / SHORT_DELAY_MS); |
382 |
|
assertEquals(0, p.getCompletedTaskCount()); |
383 |
|
threadProceed.countDown(); |
384 |
|
threadDone.await(); |
385 |
< |
Thread.sleep(SHORT_DELAY_MS); |
385 |
> |
delay(SHORT_DELAY_MS); |
386 |
|
assertEquals(1, p.getCompletedTaskCount()); |
387 |
|
} finally { |
388 |
|
joinPool(p); |
657 |
|
long count = p.getTaskCount(); |
658 |
|
if (count >= 0 && count <= max) |
659 |
|
break; |
660 |
< |
Thread.sleep(1); |
660 |
> |
delay(1); |
661 |
|
} |
662 |
|
assertTrue(k < SMALL_DELAY_MS); |
663 |
|
} finally { |