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

Comparing jsr166/src/test/tck/ExecutorsTest.java (file contents):
Revision 1.53 by jsr166, Sat Feb 1 17:44:35 2020 UTC vs.
Revision 1.54 by jsr166, Sat Feb 1 18:52:17 2020 UTC

# Line 279 | Line 279 | public class ExecutorsTest extends JSR16
279              Executors.newScheduledThreadPool(2),
280          };
281  
282 +        final CountDownLatch done = new CountDownLatch(1);
283 +
284          final Runnable sleeper = new CheckedRunnable() {
285              public void realRun() throws InterruptedException {
286 <                try {
285 <                    delay(LONG_DELAY_MS);
286 <                } catch (InterruptedException OK) {
287 <                }
286 >                done.await(LONG_DELAY_MS, MILLISECONDS);
287              }};
288  
289          List<Thread> threads = new ArrayList<>();
# Line 297 | Line 296 | public class ExecutorsTest extends JSR16
296          }
297          for (Thread thread : threads)
298              awaitTermination(thread);
299 <        for (ExecutorService executor : executors)
301 <            executor.shutdownNow(); // assumes shutdownNow interrupts threads
299 >        done.countDown();
300          for (ExecutorService executor : executors)
301              joinPool(executor);
302      }

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines