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

Comparing jsr166/src/test/tck/ThreadPoolExecutorSubclassTest.java (file contents):
Revision 1.61 by jsr166, Sun Oct 4 02:00:19 2015 UTC vs.
Revision 1.62 by jsr166, Sun Oct 4 02:04:56 2015 UTC

# Line 480 | Line 480 | public class ThreadPoolExecutorSubclassT
480              new CustomTPE(THREADS, THREADS,
481                            LONG_DELAY_MS, MILLISECONDS,
482                            new ArrayBlockingQueue<Runnable>(10));
483 <        final CountDownLatch threadsStarted = new CountDownLatch(THREADS);
484 <        final CountDownLatch done = new CountDownLatch(1);
485 <        try {
483 >        try (PoolCleaner cleaner = cleaner(p)) {
484 >            final CountDownLatch threadsStarted = new CountDownLatch(THREADS);
485 >            final CountDownLatch done = new CountDownLatch(1);
486              assertEquals(0, p.getLargestPoolSize());
487              for (int i = 0; i < THREADS; i++)
488                  p.execute(new CheckedRunnable() {
# Line 491 | Line 491 | public class ThreadPoolExecutorSubclassT
491                          done.await();
492                          assertEquals(THREADS, p.getLargestPoolSize());
493                      }});
494 <            assertTrue(threadsStarted.await(SMALL_DELAY_MS, MILLISECONDS));
495 <            assertEquals(THREADS, p.getLargestPoolSize());
496 <        } finally {
497 <            done.countDown();
498 <            joinPool(p);
494 >            assertTrue(threadsStarted.await(MEDIUM_DELAY_MS, MILLISECONDS));
495              assertEquals(THREADS, p.getLargestPoolSize());
496 +            done.countDown();   // release pool
497          }
498 +        assertEquals(THREADS, p.getLargestPoolSize());
499      }
500  
501      /**

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines