607 |
|
final ScheduledThreadPoolExecutor p = new ScheduledThreadPoolExecutor(1); |
608 |
|
try (PoolCleaner cleaner = cleaner(p, releaser)) { |
609 |
|
for (int i = 0; i < tasks.length; i++) |
610 |
< |
tasks[i] = p.schedule(new SmallPossiblyInterruptedRunnable(), |
610 |
> |
tasks[i] = p.schedule(possiblyInterruptedRunnable(SMALL_DELAY_MS), |
611 |
|
LONG_DELAY_MS, MILLISECONDS); |
612 |
|
int max = tasks.length; |
613 |
|
if (tasks[4].cancel(true)) --max; |
639 |
|
Runnable waiter = new CheckedRunnable() { public void realRun() { |
640 |
|
threadsStarted.countDown(); |
641 |
|
try { |
642 |
< |
MILLISECONDS.sleep(2 * LONG_DELAY_MS); |
642 |
> |
MILLISECONDS.sleep(LONGER_DELAY_MS); |
643 |
|
} catch (InterruptedException success) {} |
644 |
|
ran.getAndIncrement(); |
645 |
|
}}; |