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.67 by jsr166, Sun Oct 4 01:23:41 2015 UTC vs.
Revision 1.68 by jsr166, Sun Oct 4 01:27:32 2015 UTC

# Line 184 | Line 184 | public class ThreadPoolExecutorTest exte
184              new ThreadPoolExecutor(2, 2,
185                                     LONG_DELAY_MS, MILLISECONDS,
186                                     new ArrayBlockingQueue<Runnable>(10));
187 <        final CountDownLatch threadStarted = new CountDownLatch(1);
188 <        final CountDownLatch threadProceed = new CountDownLatch(1);
189 <        final CountDownLatch threadDone = new CountDownLatch(1);
190 <        try {
187 >        try (PoolCleaner cleaner = cleaner(p)) {
188 >            final CountDownLatch threadStarted = new CountDownLatch(1);
189 >            final CountDownLatch threadProceed = new CountDownLatch(1);
190 >            final CountDownLatch threadDone = new CountDownLatch(1);
191              assertEquals(0, p.getCompletedTaskCount());
192              p.execute(new CheckedRunnable() {
193                  public void realRun() throws InterruptedException {
# Line 206 | Line 206 | public class ThreadPoolExecutorTest exte
206                      fail("timed out");
207                  Thread.yield();
208              }
209        } finally {
210            joinPool(p);
209          }
210      }
211  

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines