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

Comparing jsr166/src/test/loops/SingleProducerMultipleConsumerLoops.java (file contents):
Revision 1.5 by jsr166, Wed Sep 1 07:47:27 2010 UTC vs.
Revision 1.10 by jsr166, Mon Aug 10 03:13:33 2015 UTC

# Line 1 | Line 1
1   /*
2   * Written by Doug Lea with assistance from members of JCP JSR-166
3   * Expert Group and released to the public domain, as explained at
4 < * http://creativecommons.org/licenses/publicdomain
4 > * http://creativecommons.org/publicdomain/zero/1.0/
5   */
6  
7   import java.util.concurrent.*;
# Line 36 | Line 36 | public class SingleProducerMultipleConsu
36          warmup();
37          print = true;
38  
39 <        int k = 1;
40 <        for (int i = 1; i <= maxn;) {
39 >        for (int k = 1, i = 1; i <= maxn;) {
40              System.out.println("Consumers:" + i);
41              oneTest(i, ITERS);
42              if (i == k) {
# Line 49 | Line 48 | public class SingleProducerMultipleConsu
48          }
49  
50          pool.shutdown();
51 <   }
51 >    }
52  
53      static void warmup() throws Exception {
54          print = false;
# Line 128 | Line 127 | public class SingleProducerMultipleConsu
127          if (print)
128              System.out.print("ArrayBlockingQueue(fair)");
129          oneRun(new ArrayBlockingQueue<Integer>(POOL_SIZE, true), n, fairIters);
131
130      }
131  
132 <    static abstract class Stage implements Runnable {
132 >    abstract static class Stage implements Runnable {
133          final int iters;
134          final BlockingQueue<Integer> queue;
135          final CyclicBarrier barrier;
# Line 170 | Line 168 | public class SingleProducerMultipleConsu
168      static class Consumer extends Stage {
169          Consumer(BlockingQueue<Integer> q, CyclicBarrier b, int iters) {
170              super(q, b, iters);
173
171          }
172  
173          public void run() {

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines