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

Comparing jsr166/src/test/loops/TimeoutProducerConsumerLoops.java (file contents):
Revision 1.6 by jsr166, Mon Nov 16 04:16:43 2009 UTC vs.
Revision 1.11 by jsr166, Thu Dec 18 18:13:06 2014 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 51 | Line 51 | public class TimeoutProducerConsumerLoop
51              maxPairs = Integer.parseInt(args[0]);
52  
53          print = true;
54 <        int k = 1;
55 <        for (int i = 1; i <= maxPairs;) {
54 >        for (int k = 1, i = 1; i <= maxPairs;) {
55              System.out.println("Pairs:" + i);
56              oneTest(i, iters);
57              Thread.sleep(100);
# Line 64 | Line 63 | public class TimeoutProducerConsumerLoop
63                  i = k;
64          }
65          pool.shutdown();
66 <   }
66 >    }
67  
68      static void oneTest(int n, int iters) throws Exception {
69          if (print)
# Line 109 | Line 108 | public class TimeoutProducerConsumerLoop
108  
109      }
110  
111 <    static abstract class Stage implements Runnable {
111 >    abstract static class Stage implements Runnable {
112          final int iters;
113          final BlockingQueue<Integer> queue;
114          final CyclicBarrier barrier;
115          final Phaser lagPhaser;
116 <        Stage (BlockingQueue<Integer> q, CyclicBarrier b, Phaser s, int iters) {
116 >        Stage(BlockingQueue<Integer> q, CyclicBarrier b, Phaser s, int iters) {
117              queue = q;
118              barrier = b;
119              lagPhaser = s;

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines