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

Comparing jsr166/src/test/tck/JSR166TestCase.java (file contents):
Revision 1.150 by jsr166, Sat Oct 3 19:08:13 2015 UTC vs.
Revision 1.151 by jsr166, Sat Oct 3 19:19:01 2015 UTC

# Line 778 | Line 778 | public class JSR166TestCase extends Test
778       * necessarily individually slow because they must block.
779       */
780      void testInParallel(Action ... actions) {
781 <        ExecutorService pool = Executors.newCachedThreadPool();
782 <        try {
781 >        try (PoolCloser<ExecutorService> poolCloser
782 >             = new PoolCloser<>(Executors.newCachedThreadPool())) {
783 >            ExecutorService pool = poolCloser.pool;
784              ArrayList<Future<?>> futures = new ArrayList<>(actions.length);
785              for (final Action action : actions)
786                  futures.add(pool.submit(new CheckedRunnable() {
# Line 792 | Line 793 | public class JSR166TestCase extends Test
793                  } catch (Exception ex) {
794                      threadUnexpectedException(ex);
795                  }
795        } finally {
796            joinPool(pool);
796          }
797      }
798  

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines