--- jsr166/src/test/tck/ThreadPoolExecutorTest.java 2015/10/04 02:38:46 1.87 +++ jsr166/src/test/tck/ThreadPoolExecutorTest.java 2015/10/04 02:46:13 1.88 @@ -1018,9 +1018,9 @@ public class ThreadPoolExecutorTest exte 60, SECONDS, new ArrayBlockingQueue(10)); - final CountDownLatch threadStarted = new CountDownLatch(1); - final CountDownLatch done = new CountDownLatch(1); - try { + try (PoolCleaner cleaner = cleaner(p)) { + final CountDownLatch threadStarted = new CountDownLatch(1); + final CountDownLatch done = new CountDownLatch(1); Thread t = newStartedThread(new CheckedInterruptedRunnable() { public void realRun() throws Exception { Callable task = new CheckedCallable() { @@ -1035,9 +1035,7 @@ public class ThreadPoolExecutorTest exte assertTrue(threadStarted.await(MEDIUM_DELAY_MS, MILLISECONDS)); t.interrupt(); awaitTermination(t, MEDIUM_DELAY_MS); - } finally { done.countDown(); - joinPool(p); } }