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.50 by jsr166, Wed Dec 31 19:05:43 2014 UTC vs.
Revision 1.61 by jsr166, Mon Sep 28 02:41:29 2015 UTC

# Line 8 | Line 8
8  
9   import static java.util.concurrent.TimeUnit.MILLISECONDS;
10   import static java.util.concurrent.TimeUnit.NANOSECONDS;
11 + import static java.util.concurrent.TimeUnit.SECONDS;
12  
13   import java.util.ArrayList;
14   import java.util.List;
15   import java.util.concurrent.ArrayBlockingQueue;
16   import java.util.concurrent.BlockingQueue;
17   import java.util.concurrent.Callable;
18 + import java.util.concurrent.CancellationException;
19   import java.util.concurrent.CountDownLatch;
20   import java.util.concurrent.ExecutionException;
21   import java.util.concurrent.Executors;
# Line 27 | Line 29 | import java.util.concurrent.SynchronousQ
29   import java.util.concurrent.ThreadFactory;
30   import java.util.concurrent.ThreadPoolExecutor;
31   import java.util.concurrent.TimeUnit;
32 + import java.util.concurrent.atomic.AtomicInteger;
33  
34   import junit.framework.Test;
35   import junit.framework.TestSuite;
36  
37   public class ThreadPoolExecutorTest extends JSR166TestCase {
38      public static void main(String[] args) {
39 <        junit.textui.TestRunner.run(suite());
39 >        main(suite(), args);
40      }
41      public static Test suite() {
42          return new TestSuite(ThreadPoolExecutorTest.class);
# Line 214 | Line 217 | public class ThreadPoolExecutorTest exte
217              new ThreadPoolExecutor(2, 2,
218                                     1000, MILLISECONDS,
219                                     new ArrayBlockingQueue<Runnable>(10));
220 <        assertEquals(1, p.getKeepAliveTime(TimeUnit.SECONDS));
220 >        assertEquals(1, p.getKeepAliveTime(SECONDS));
221          joinPool(p);
222      }
223  
# Line 622 | Line 625 | public class ThreadPoolExecutorTest exte
625      }
626  
627      /**
628 <     * shutdownNow returns a list containing tasks that were not run
628 >     * shutdownNow returns a list containing tasks that were not run,
629 >     * and those tasks are drained from the queue
630       */
631 <    public void testShutdownNow() {
631 >    public void testShutdownNow() throws InterruptedException {
632 >        final int poolSize = 2;
633 >        final int count = 5;
634 >        final AtomicInteger ran = new AtomicInteger(0);
635          final ThreadPoolExecutor p =
636 <            new ThreadPoolExecutor(1, 1,
636 >            new ThreadPoolExecutor(poolSize, poolSize,
637                                     LONG_DELAY_MS, MILLISECONDS,
638                                     new ArrayBlockingQueue<Runnable>(10));
639 <        List l;
640 <        try {
641 <            for (int i = 0; i < 5; i++)
635 <                p.execute(new MediumPossiblyInterruptedRunnable());
636 <        }
637 <        finally {
639 >        CountDownLatch threadsStarted = new CountDownLatch(poolSize);
640 >        CheckedRunnable waiter = new CheckedRunnable() { public void realRun() {
641 >            threadsStarted.countDown();
642              try {
643 <                l = p.shutdownNow();
644 <            } catch (SecurityException ok) { return; }
643 >                MILLISECONDS.sleep(2 * LONG_DELAY_MS);
644 >            } catch (InterruptedException success) {}
645 >            ran.getAndIncrement();
646 >        }};
647 >        for (int i = 0; i < count; i++)
648 >            p.execute(waiter);
649 >        assertTrue(threadsStarted.await(LONG_DELAY_MS, MILLISECONDS));
650 >        final List<Runnable> queuedTasks;
651 >        try {
652 >            queuedTasks = p.shutdownNow();
653 >        } catch (SecurityException ok) {
654 >            return; // Allowed in case test doesn't have privs
655          }
656          assertTrue(p.isShutdown());
657 <        assertTrue(l.size() <= 4);
657 >        assertTrue(p.getQueue().isEmpty());
658 >        assertEquals(count - poolSize, queuedTasks.size());
659 >        assertTrue(p.awaitTermination(LONG_DELAY_MS, MILLISECONDS));
660 >        assertTrue(p.isTerminated());
661 >        assertEquals(poolSize, ran.get());
662      }
663  
664      // Exception Tests
# Line 650 | Line 668 | public class ThreadPoolExecutorTest exte
668       */
669      public void testConstructor1() {
670          try {
671 <            new ThreadPoolExecutor(-1, 1,
654 <                                   LONG_DELAY_MS, MILLISECONDS,
671 >            new ThreadPoolExecutor(-1, 1, 1L, SECONDS,
672                                     new ArrayBlockingQueue<Runnable>(10));
673              shouldThrow();
674          } catch (IllegalArgumentException success) {}
# Line 662 | Line 679 | public class ThreadPoolExecutorTest exte
679       */
680      public void testConstructor2() {
681          try {
682 <            new ThreadPoolExecutor(1, -1,
666 <                                   LONG_DELAY_MS, MILLISECONDS,
682 >            new ThreadPoolExecutor(1, -1, 1L, SECONDS,
683                                     new ArrayBlockingQueue<Runnable>(10));
684              shouldThrow();
685          } catch (IllegalArgumentException success) {}
# Line 674 | Line 690 | public class ThreadPoolExecutorTest exte
690       */
691      public void testConstructor3() {
692          try {
693 <            new ThreadPoolExecutor(1, 0,
678 <                                   LONG_DELAY_MS, MILLISECONDS,
693 >            new ThreadPoolExecutor(1, 0, 1L, SECONDS,
694                                     new ArrayBlockingQueue<Runnable>(10));
695              shouldThrow();
696          } catch (IllegalArgumentException success) {}
# Line 686 | Line 701 | public class ThreadPoolExecutorTest exte
701       */
702      public void testConstructor4() {
703          try {
704 <            new ThreadPoolExecutor(1, 2,
690 <                                   -1L, MILLISECONDS,
704 >            new ThreadPoolExecutor(1, 2, -1L, SECONDS,
705                                     new ArrayBlockingQueue<Runnable>(10));
706              shouldThrow();
707          } catch (IllegalArgumentException success) {}
# Line 698 | Line 712 | public class ThreadPoolExecutorTest exte
712       */
713      public void testConstructor5() {
714          try {
715 <            new ThreadPoolExecutor(2, 1,
702 <                                   LONG_DELAY_MS, MILLISECONDS,
715 >            new ThreadPoolExecutor(2, 1, 1L, SECONDS,
716                                     new ArrayBlockingQueue<Runnable>(10));
717              shouldThrow();
718          } catch (IllegalArgumentException success) {}
# Line 710 | Line 723 | public class ThreadPoolExecutorTest exte
723       */
724      public void testConstructorNullPointerException() {
725          try {
726 <            new ThreadPoolExecutor(1, 2,
714 <                                   LONG_DELAY_MS, MILLISECONDS,
726 >            new ThreadPoolExecutor(1, 2, 1L, SECONDS,
727                                     (BlockingQueue) null);
728              shouldThrow();
729          } catch (NullPointerException success) {}
# Line 722 | Line 734 | public class ThreadPoolExecutorTest exte
734       */
735      public void testConstructor6() {
736          try {
737 <            new ThreadPoolExecutor(-1, 1,
726 <                                   LONG_DELAY_MS, MILLISECONDS,
737 >            new ThreadPoolExecutor(-1, 1, 1L, SECONDS,
738                                     new ArrayBlockingQueue<Runnable>(10),
739                                     new SimpleThreadFactory());
740              shouldThrow();
# Line 735 | Line 746 | public class ThreadPoolExecutorTest exte
746       */
747      public void testConstructor7() {
748          try {
749 <            new ThreadPoolExecutor(1, -1,
739 <                                   LONG_DELAY_MS, MILLISECONDS,
749 >            new ThreadPoolExecutor(1, -1, 1L, SECONDS,
750                                     new ArrayBlockingQueue<Runnable>(10),
751                                     new SimpleThreadFactory());
752              shouldThrow();
# Line 748 | Line 758 | public class ThreadPoolExecutorTest exte
758       */
759      public void testConstructor8() {
760          try {
761 <            new ThreadPoolExecutor(1, 0,
752 <                                   LONG_DELAY_MS, MILLISECONDS,
761 >            new ThreadPoolExecutor(1, 0, 1L, SECONDS,
762                                     new ArrayBlockingQueue<Runnable>(10),
763                                     new SimpleThreadFactory());
764              shouldThrow();
# Line 761 | Line 770 | public class ThreadPoolExecutorTest exte
770       */
771      public void testConstructor9() {
772          try {
773 <            new ThreadPoolExecutor(1, 2,
765 <                                   -1L, MILLISECONDS,
773 >            new ThreadPoolExecutor(1, 2, -1L, SECONDS,
774                                     new ArrayBlockingQueue<Runnable>(10),
775                                     new SimpleThreadFactory());
776              shouldThrow();
# Line 774 | Line 782 | public class ThreadPoolExecutorTest exte
782       */
783      public void testConstructor10() {
784          try {
785 <            new ThreadPoolExecutor(2, 1,
778 <                                   LONG_DELAY_MS, MILLISECONDS,
785 >            new ThreadPoolExecutor(2, 1, 1L, SECONDS,
786                                     new ArrayBlockingQueue<Runnable>(10),
787                                     new SimpleThreadFactory());
788              shouldThrow();
# Line 787 | Line 794 | public class ThreadPoolExecutorTest exte
794       */
795      public void testConstructorNullPointerException2() {
796          try {
797 <            new ThreadPoolExecutor(1, 2,
791 <                                   LONG_DELAY_MS, MILLISECONDS,
797 >            new ThreadPoolExecutor(1, 2, 1L, SECONDS,
798                                     (BlockingQueue) null,
799                                     new SimpleThreadFactory());
800              shouldThrow();
# Line 800 | Line 806 | public class ThreadPoolExecutorTest exte
806       */
807      public void testConstructorNullPointerException3() {
808          try {
809 <            new ThreadPoolExecutor(1, 2,
804 <                                   LONG_DELAY_MS, MILLISECONDS,
809 >            new ThreadPoolExecutor(1, 2, 1L, SECONDS,
810                                     new ArrayBlockingQueue<Runnable>(10),
811                                     (ThreadFactory) null);
812              shouldThrow();
# Line 813 | Line 818 | public class ThreadPoolExecutorTest exte
818       */
819      public void testConstructor11() {
820          try {
821 <            new ThreadPoolExecutor(-1, 1,
817 <                                   LONG_DELAY_MS, MILLISECONDS,
821 >            new ThreadPoolExecutor(-1, 1, 1L, SECONDS,
822                                     new ArrayBlockingQueue<Runnable>(10),
823                                     new NoOpREHandler());
824              shouldThrow();
# Line 826 | Line 830 | public class ThreadPoolExecutorTest exte
830       */
831      public void testConstructor12() {
832          try {
833 <            new ThreadPoolExecutor(1, -1,
830 <                                   LONG_DELAY_MS, MILLISECONDS,
833 >            new ThreadPoolExecutor(1, -1, 1L, SECONDS,
834                                     new ArrayBlockingQueue<Runnable>(10),
835                                     new NoOpREHandler());
836              shouldThrow();
# Line 839 | Line 842 | public class ThreadPoolExecutorTest exte
842       */
843      public void testConstructor13() {
844          try {
845 <            new ThreadPoolExecutor(1, 0,
843 <                                   LONG_DELAY_MS, MILLISECONDS,
845 >            new ThreadPoolExecutor(1, 0, 1L, SECONDS,
846                                     new ArrayBlockingQueue<Runnable>(10),
847                                     new NoOpREHandler());
848              shouldThrow();
# Line 852 | Line 854 | public class ThreadPoolExecutorTest exte
854       */
855      public void testConstructor14() {
856          try {
857 <            new ThreadPoolExecutor(1, 2,
856 <                                   -1L, MILLISECONDS,
857 >            new ThreadPoolExecutor(1, 2, -1L, SECONDS,
858                                     new ArrayBlockingQueue<Runnable>(10),
859                                     new NoOpREHandler());
860              shouldThrow();
# Line 865 | Line 866 | public class ThreadPoolExecutorTest exte
866       */
867      public void testConstructor15() {
868          try {
869 <            new ThreadPoolExecutor(2, 1,
869 <                                   LONG_DELAY_MS, MILLISECONDS,
869 >            new ThreadPoolExecutor(2, 1, 1L, SECONDS,
870                                     new ArrayBlockingQueue<Runnable>(10),
871                                     new NoOpREHandler());
872              shouldThrow();
# Line 878 | Line 878 | public class ThreadPoolExecutorTest exte
878       */
879      public void testConstructorNullPointerException4() {
880          try {
881 <            new ThreadPoolExecutor(1, 2,
882 <                                   LONG_DELAY_MS, MILLISECONDS,
881 >            new ThreadPoolExecutor(1, 2, 1L, SECONDS,
882                                     (BlockingQueue) null,
883                                     new NoOpREHandler());
884              shouldThrow();
# Line 891 | Line 890 | public class ThreadPoolExecutorTest exte
890       */
891      public void testConstructorNullPointerException5() {
892          try {
893 <            new ThreadPoolExecutor(1, 2,
895 <                                   LONG_DELAY_MS, MILLISECONDS,
893 >            new ThreadPoolExecutor(1, 2, 1L, SECONDS,
894                                     new ArrayBlockingQueue<Runnable>(10),
895                                     (RejectedExecutionHandler) null);
896              shouldThrow();
# Line 904 | Line 902 | public class ThreadPoolExecutorTest exte
902       */
903      public void testConstructor16() {
904          try {
905 <            new ThreadPoolExecutor(-1, 1,
908 <                                   LONG_DELAY_MS, MILLISECONDS,
905 >            new ThreadPoolExecutor(-1, 1, 1L, SECONDS,
906                                     new ArrayBlockingQueue<Runnable>(10),
907                                     new SimpleThreadFactory(),
908                                     new NoOpREHandler());
# Line 918 | Line 915 | public class ThreadPoolExecutorTest exte
915       */
916      public void testConstructor17() {
917          try {
918 <            new ThreadPoolExecutor(1, -1,
922 <                                   LONG_DELAY_MS, MILLISECONDS,
918 >            new ThreadPoolExecutor(1, -1, 1L, SECONDS,
919                                     new ArrayBlockingQueue<Runnable>(10),
920                                     new SimpleThreadFactory(),
921                                     new NoOpREHandler());
# Line 932 | Line 928 | public class ThreadPoolExecutorTest exte
928       */
929      public void testConstructor18() {
930          try {
931 <            new ThreadPoolExecutor(1, 0,
936 <                                   LONG_DELAY_MS, MILLISECONDS,
931 >            new ThreadPoolExecutor(1, 0, 1L, SECONDS,
932                                     new ArrayBlockingQueue<Runnable>(10),
933                                     new SimpleThreadFactory(),
934                                     new NoOpREHandler());
# Line 946 | Line 941 | public class ThreadPoolExecutorTest exte
941       */
942      public void testConstructor19() {
943          try {
944 <            new ThreadPoolExecutor(1, 2,
950 <                                   -1L, MILLISECONDS,
944 >            new ThreadPoolExecutor(1, 2, -1L, SECONDS,
945                                     new ArrayBlockingQueue<Runnable>(10),
946                                     new SimpleThreadFactory(),
947                                     new NoOpREHandler());
# Line 960 | Line 954 | public class ThreadPoolExecutorTest exte
954       */
955      public void testConstructor20() {
956          try {
957 <            new ThreadPoolExecutor(2, 1,
964 <                                   LONG_DELAY_MS, MILLISECONDS,
957 >            new ThreadPoolExecutor(2, 1, 1L, SECONDS,
958                                     new ArrayBlockingQueue<Runnable>(10),
959                                     new SimpleThreadFactory(),
960                                     new NoOpREHandler());
# Line 974 | Line 967 | public class ThreadPoolExecutorTest exte
967       */
968      public void testConstructorNullPointerException6() {
969          try {
970 <            new ThreadPoolExecutor(1, 2,
978 <                                   LONG_DELAY_MS, MILLISECONDS,
970 >            new ThreadPoolExecutor(1, 2, 1L, SECONDS,
971                                     (BlockingQueue) null,
972                                     new SimpleThreadFactory(),
973                                     new NoOpREHandler());
# Line 988 | Line 980 | public class ThreadPoolExecutorTest exte
980       */
981      public void testConstructorNullPointerException7() {
982          try {
983 <            new ThreadPoolExecutor(1, 2,
992 <                                   LONG_DELAY_MS, MILLISECONDS,
983 >            new ThreadPoolExecutor(1, 2, 1L, SECONDS,
984                                     new ArrayBlockingQueue<Runnable>(10),
985                                     new SimpleThreadFactory(),
986                                     (RejectedExecutionHandler) null);
# Line 1002 | Line 993 | public class ThreadPoolExecutorTest exte
993       */
994      public void testConstructorNullPointerException8() {
995          try {
996 <            new ThreadPoolExecutor(1, 2,
1006 <                                   LONG_DELAY_MS, MILLISECONDS,
996 >            new ThreadPoolExecutor(1, 2, 1L, SECONDS,
997                                     new ArrayBlockingQueue<Runnable>(10),
998                                     (ThreadFactory) null,
999                                     new NoOpREHandler());
# Line 1017 | Line 1007 | public class ThreadPoolExecutorTest exte
1007      public void testInterruptedSubmit() throws InterruptedException {
1008          final ThreadPoolExecutor p =
1009              new ThreadPoolExecutor(1, 1,
1010 <                                   60, TimeUnit.SECONDS,
1010 >                                   60, SECONDS,
1011                                     new ArrayBlockingQueue<Runnable>(10));
1012  
1013          final CountDownLatch threadStarted = new CountDownLatch(1);
# Line 1291 | Line 1281 | public class ThreadPoolExecutorTest exte
1281       */
1282      public void testExecuteNull() {
1283          ThreadPoolExecutor p =
1284 <            new ThreadPoolExecutor(1, 2,
1295 <                                   LONG_DELAY_MS, MILLISECONDS,
1284 >            new ThreadPoolExecutor(1, 2, 1L, SECONDS,
1285                                     new ArrayBlockingQueue<Runnable>(10));
1286          try {
1287              p.execute(null);
# Line 1359 | Line 1348 | public class ThreadPoolExecutorTest exte
1348      }
1349  
1350      /**
1351 +     * Configuration changes that allow core pool size greater than
1352 +     * max pool size result in IllegalArgumentException.
1353 +     */
1354 +    public void testPoolSizeInvariants() {
1355 +        ThreadPoolExecutor p =
1356 +            new ThreadPoolExecutor(1, 1,
1357 +                                   LONG_DELAY_MS, MILLISECONDS,
1358 +                                   new ArrayBlockingQueue<Runnable>(10));
1359 +        for (int s = 1; s < 5; s++) {
1360 +            p.setMaximumPoolSize(s);
1361 +            p.setCorePoolSize(s);
1362 +            try {
1363 +                p.setMaximumPoolSize(s - 1);
1364 +                shouldThrow();
1365 +            } catch (IllegalArgumentException success) {}
1366 +            assertEquals(s, p.getCorePoolSize());
1367 +            assertEquals(s, p.getMaximumPoolSize());
1368 +            try {
1369 +                p.setCorePoolSize(s + 1);
1370 +                shouldThrow();
1371 +            } catch (IllegalArgumentException success) {}
1372 +            assertEquals(s, p.getCorePoolSize());
1373 +            assertEquals(s, p.getMaximumPoolSize());
1374 +        }
1375 +        joinPool(p);
1376 +    }
1377 +
1378 +    /**
1379       * setKeepAliveTime throws IllegalArgumentException
1380       * when given a negative value
1381       */
# Line 1892 | Line 1909 | public class ThreadPoolExecutorTest exte
1909                                     LONG_DELAY_MS, MILLISECONDS,
1910                                     new ArrayBlockingQueue<Runnable>(10));
1911          try {
1912 <            List<Callable<String>> l = new ArrayList<Callable<String>>();
1913 <            l.add(new StringTask());
1914 <            l.add(Executors.callable(new MediumPossiblyInterruptedRunnable(), TEST_STRING));
1915 <            l.add(new StringTask());
1916 <            List<Future<String>> futures =
1917 <                e.invokeAll(l, SHORT_DELAY_MS, MILLISECONDS);
1918 <            assertEquals(l.size(), futures.size());
1919 <            for (Future future : futures)
1920 <                assertTrue(future.isDone());
1921 <            assertFalse(futures.get(0).isCancelled());
1922 <            assertTrue(futures.get(1).isCancelled());
1912 >            for (long timeout = timeoutMillis();;) {
1913 >                List<Callable<String>> tasks = new ArrayList<>();
1914 >                tasks.add(new StringTask("0"));
1915 >                tasks.add(Executors.callable(new LongPossiblyInterruptedRunnable(), TEST_STRING));
1916 >                tasks.add(new StringTask("2"));
1917 >                long startTime = System.nanoTime();
1918 >                List<Future<String>> futures =
1919 >                    e.invokeAll(tasks, timeout, MILLISECONDS);
1920 >                assertEquals(tasks.size(), futures.size());
1921 >                assertTrue(millisElapsedSince(startTime) >= timeout);
1922 >                for (Future future : futures)
1923 >                    assertTrue(future.isDone());
1924 >                assertTrue(futures.get(1).isCancelled());
1925 >                try {
1926 >                    assertEquals("0", futures.get(0).get());
1927 >                    assertEquals("2", futures.get(2).get());
1928 >                    break;
1929 >                } catch (CancellationException retryWithLongerTimeout) {
1930 >                    timeout *= 2;
1931 >                    if (timeout >= LONG_DELAY_MS / 2)
1932 >                        fail("expected exactly one task to be cancelled");
1933 >                }
1934 >            }
1935          } finally {
1936              joinPool(e);
1937          }
# Line 1948 | Line 1977 | public class ThreadPoolExecutorTest exte
1977       * allowCoreThreadTimeOut(true) causes idle threads to time out
1978       */
1979      public void testAllowCoreThreadTimeOut_true() throws Exception {
1980 <        long coreThreadTimeOut = SHORT_DELAY_MS;
1980 >        long keepAliveTime = timeoutMillis();
1981          final ThreadPoolExecutor p =
1982              new ThreadPoolExecutor(2, 10,
1983 <                                   coreThreadTimeOut, MILLISECONDS,
1983 >                                   keepAliveTime, MILLISECONDS,
1984                                     new ArrayBlockingQueue<Runnable>(10));
1985          final CountDownLatch threadStarted = new CountDownLatch(1);
1986          try {
# Line 1962 | Line 1991 | public class ThreadPoolExecutorTest exte
1991                      assertEquals(1, p.getPoolSize());
1992                  }});
1993              await(threadStarted);
1994 <            delay(coreThreadTimeOut);
1994 >            delay(keepAliveTime);
1995              long startTime = System.nanoTime();
1996              while (p.getPoolSize() > 0
1997                     && millisElapsedSince(startTime) < LONG_DELAY_MS)
# Line 1978 | Line 2007 | public class ThreadPoolExecutorTest exte
2007       * allowCoreThreadTimeOut(false) causes idle threads not to time out
2008       */
2009      public void testAllowCoreThreadTimeOut_false() throws Exception {
2010 <        long coreThreadTimeOut = SHORT_DELAY_MS;
2010 >        long keepAliveTime = timeoutMillis();
2011          final ThreadPoolExecutor p =
2012              new ThreadPoolExecutor(2, 10,
2013 <                                   coreThreadTimeOut, MILLISECONDS,
2013 >                                   keepAliveTime, MILLISECONDS,
2014                                     new ArrayBlockingQueue<Runnable>(10));
2015          final CountDownLatch threadStarted = new CountDownLatch(1);
2016          try {
# Line 1991 | Line 2020 | public class ThreadPoolExecutorTest exte
2020                      threadStarted.countDown();
2021                      assertTrue(p.getPoolSize() >= 1);
2022                  }});
2023 <            delay(2 * coreThreadTimeOut);
2023 >            delay(2 * keepAliveTime);
2024              assertTrue(p.getPoolSize() >= 1);
2025          } finally {
2026              joinPool(p);
# Line 2010 | Line 2039 | public class ThreadPoolExecutorTest exte
2039                  done.countDown();
2040              }};
2041          final ThreadPoolExecutor p =
2042 <            new ThreadPoolExecutor(1, 30, 60, TimeUnit.SECONDS,
2042 >            new ThreadPoolExecutor(1, 30,
2043 >                                   60, SECONDS,
2044                                     new ArrayBlockingQueue(30));
2045          try {
2046              for (int i = 0; i < nTasks; ++i) {

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines