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.80 by jsr166, Sun Oct 4 02:21:43 2015 UTC vs.
Revision 1.81 by jsr166, Sun Oct 4 02:24:49 2015 UTC

# Line 402 | Line 402 | public class ThreadPoolExecutorTest exte
402              new ThreadPoolExecutor(1, 1,
403                                     LONG_DELAY_MS, MILLISECONDS,
404                                     new ArrayBlockingQueue<Runnable>(10));
405 <        final CountDownLatch threadStarted = new CountDownLatch(1);
406 <        final CountDownLatch done = new CountDownLatch(1);
407 <        try {
405 >        try (PoolCleaner cleaner = cleaner(p)) {
406 >            final CountDownLatch threadStarted = new CountDownLatch(1);
407 >            final CountDownLatch done = new CountDownLatch(1);
408              assertEquals(0, p.getTaskCount());
409              p.execute(new CheckedRunnable() {
410                  public void realRun() throws InterruptedException {
# Line 414 | Line 414 | public class ThreadPoolExecutorTest exte
414                  }});
415              assertTrue(threadStarted.await(MEDIUM_DELAY_MS, MILLISECONDS));
416              assertEquals(1, p.getTaskCount());
417        } finally {
417              done.countDown();
419            joinPool(p);
418          }
419      }
420  

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines