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.88 by jsr166, Sun Oct 4 02:46:13 2015 UTC vs.
Revision 1.89 by jsr166, Sun Oct 4 02:49:18 2015 UTC

# Line 1043 | Line 1043 | public class ThreadPoolExecutorTest exte
1043       * execute throws RejectedExecutionException if saturated.
1044       */
1045      public void testSaturatedExecute() {
1046 <        ThreadPoolExecutor p =
1046 >        final ThreadPoolExecutor p =
1047              new ThreadPoolExecutor(1, 1,
1048                                     LONG_DELAY_MS, MILLISECONDS,
1049                                     new ArrayBlockingQueue<Runnable>(1));
1050 <        final CountDownLatch done = new CountDownLatch(1);
1051 <        try {
1050 >        try (PoolCleaner cleaner = cleaner(p)) {
1051 >            final CountDownLatch done = new CountDownLatch(1);
1052              Runnable task = new CheckedRunnable() {
1053                  public void realRun() throws InterruptedException {
1054                      done.await();
# Line 1062 | Line 1062 | public class ThreadPoolExecutorTest exte
1062                  } catch (RejectedExecutionException success) {}
1063                  assertTrue(p.getTaskCount() <= 2);
1064              }
1065        } finally {
1065              done.countDown();
1067            joinPool(p);
1066          }
1067      }
1068  

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines