438 |
|
* getThreadFactory returns factory in constructor if not set |
439 |
|
*/ |
440 |
|
public void testGetThreadFactory() throws InterruptedException { |
441 |
< |
ThreadFactory threadFactory = new SimpleThreadFactory(); |
442 |
< |
ScheduledThreadPoolExecutor p = new ScheduledThreadPoolExecutor(1, threadFactory); |
443 |
< |
assertSame(threadFactory, p.getThreadFactory()); |
444 |
< |
joinPool(p); |
441 |
> |
final ThreadFactory threadFactory = new SimpleThreadFactory(); |
442 |
> |
final ScheduledThreadPoolExecutor p = |
443 |
> |
new ScheduledThreadPoolExecutor(1, threadFactory); |
444 |
> |
try (PoolCleaner cleaner = cleaner(p)) { |
445 |
> |
assertSame(threadFactory, p.getThreadFactory()); |
446 |
> |
} |
447 |
|
} |
448 |
|
|
449 |
|
/** |
632 |
|
final AtomicInteger ran = new AtomicInteger(0); |
633 |
|
final ScheduledThreadPoolExecutor p = |
634 |
|
new ScheduledThreadPoolExecutor(poolSize); |
635 |
< |
CountDownLatch threadsStarted = new CountDownLatch(poolSize); |
635 |
> |
final CountDownLatch threadsStarted = new CountDownLatch(poolSize); |
636 |
|
Runnable waiter = new CheckedRunnable() { public void realRun() { |
637 |
|
threadsStarted.countDown(); |
638 |
|
try { |