ViewVC Help
View File | Revision Log | Show Annotations | Download File | Root Listing
root/jsr166/jsr166/src/test/tck/ThreadPoolExecutorTest.java
(Generate patch)

Comparing jsr166/src/test/tck/ThreadPoolExecutorTest.java (file contents):
Revision 1.77 by jsr166, Sun Oct 4 02:07:32 2015 UTC vs.
Revision 1.78 by jsr166, Sun Oct 4 02:09:57 2015 UTC

# Line 384 | Line 384 | public class ThreadPoolExecutorTest exte
384              new ThreadPoolExecutor(1, 1,
385                                     LONG_DELAY_MS, MILLISECONDS,
386                                     new ArrayBlockingQueue<Runnable>(10));
387 <        final CountDownLatch threadStarted = new CountDownLatch(1);
388 <        final CountDownLatch done = new CountDownLatch(1);
389 <        try {
387 >        try (PoolCleaner cleaner = cleaner(p)) {
388 >            final CountDownLatch threadStarted = new CountDownLatch(1);
389 >            final CountDownLatch done = new CountDownLatch(1);
390              assertEquals(0, p.getPoolSize());
391              p.execute(new CheckedRunnable() {
392                  public void realRun() throws InterruptedException {
# Line 394 | Line 394 | public class ThreadPoolExecutorTest exte
394                      assertEquals(1, p.getPoolSize());
395                      done.await();
396                  }});
397 <            assertTrue(threadStarted.await(SMALL_DELAY_MS, MILLISECONDS));
397 >            assertTrue(threadStarted.await(MEDIUM_DELAY_MS, MILLISECONDS));
398              assertEquals(1, p.getPoolSize());
399 <        } finally {
400 <            done.countDown();
401 <            joinPool(p);
399 >            done.countDown();   // release pool
400          }
401      }
402  

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines