150 |
|
RunnableCounter counter = new RunnableCounter(); |
151 |
|
ScheduledFuture h = |
152 |
|
p.scheduleAtFixedRate(counter, 0, 1, MILLISECONDS); |
153 |
< |
Thread.sleep(SMALL_DELAY_MS); |
153 |
> |
delay(SMALL_DELAY_MS); |
154 |
|
h.cancel(true); |
155 |
|
int c = counter.count.get(); |
156 |
|
// By time scaling conventions, we must have at least |
168 |
|
RunnableCounter counter = new RunnableCounter(); |
169 |
|
ScheduledFuture h = |
170 |
|
p.scheduleWithFixedDelay(counter, 0, 1, MILLISECONDS); |
171 |
< |
Thread.sleep(SMALL_DELAY_MS); |
171 |
> |
delay(SMALL_DELAY_MS); |
172 |
|
h.cancel(true); |
173 |
|
int c = counter.count.get(); |
174 |
|
assertTrue(c >= SMALL_DELAY_MS / SHORT_DELAY_MS); |
331 |
|
assertEquals(0, p.getCompletedTaskCount()); |
332 |
|
threadProceed.countDown(); |
333 |
|
threadDone.await(); |
334 |
< |
Thread.sleep(SHORT_DELAY_MS); |
334 |
> |
delay(SHORT_DELAY_MS); |
335 |
|
assertEquals(1, p.getCompletedTaskCount()); |
336 |
|
} finally { |
337 |
|
joinPool(p); |
607 |
|
long count = p.getTaskCount(); |
608 |
|
if (count >= 0 && count <= max) |
609 |
|
break; |
610 |
< |
Thread.sleep(1); |
610 |
> |
delay(1); |
611 |
|
} |
612 |
|
assertTrue(k < SMALL_DELAY_MS); |
613 |
|
} finally { |