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

Comparing jsr166/src/test/tck/ForkJoinPoolTest.java (file contents):
Revision 1.63 by jsr166, Sun Oct 4 08:27:41 2015 UTC vs.
Revision 1.64 by jsr166, Mon Oct 5 22:54:45 2015 UTC

# Line 548 | Line 548 | public class ForkJoinPoolTest extends JS
548      public void testInterruptedSubmit() throws InterruptedException {
549          final CountDownLatch submitted    = new CountDownLatch(1);
550          final CountDownLatch quittingTime = new CountDownLatch(1);
551        final ExecutorService p = new ForkJoinPool(1);
551          final Callable<Void> awaiter = new CheckedCallable<Void>() {
552              public Void realCall() throws InterruptedException {
553 <                assertTrue(quittingTime.await(MEDIUM_DELAY_MS, MILLISECONDS));
553 >                assertTrue(quittingTime.await(2*LONG_DELAY_MS, MILLISECONDS));
554                  return null;
555              }};
556 <        try {
556 >        final ExecutorService p = new ForkJoinPool(1);
557 >        try (PoolCleaner cleaner = cleaner(p, quittingTime)) {
558              Thread t = new Thread(new CheckedInterruptedRunnable() {
559                  public void realRun() throws Exception {
560                      Future<Void> future = p.submit(awaiter);
# Line 562 | Line 562 | public class ForkJoinPoolTest extends JS
562                      future.get();
563                  }});
564              t.start();
565 <            assertTrue(submitted.await(MEDIUM_DELAY_MS, MILLISECONDS));
565 >            await(submitted);
566              t.interrupt();
567 <            t.join();
568 <        } finally {
569 <            quittingTime.countDown();
570 <            joinPool(p);
567 >            awaitTermination(t);
568          }
569      }
570  

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines