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

Comparing jsr166/src/test/loops/ConcurrentDequeLoops.java (file contents):
Revision 1.4 by jsr166, Mon Nov 2 23:42:46 2009 UTC vs.
Revision 1.8 by jsr166, Tue Mar 15 19:47:05 2011 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.*;
# Line 61 | Line 61 | public class ConcurrentDequeLoops {
61          final CyclicBarrier barrier;
62          final LoopHelpers.SimpleRandom rng = new LoopHelpers.SimpleRandom();
63          int items;
64 <        Stage (Deque<Integer> q, CyclicBarrier b, int items) {
64 >        Stage(Deque<Integer> q, CyclicBarrier b, int items) {
65              queue = q;
66              barrier = b;
67              this.items = items;
# Line 72 | Line 72 | public class ConcurrentDequeLoops {
72              // transform it, and put back in.
73              try {
74                  barrier.await();
75 <                int l = (int)System.nanoTime();
75 >                int l = (int) System.nanoTime();
76                  int takes = 0;
77                  for (;;) {
78                      Integer item;
# Line 118 | Line 118 | public class ConcurrentDequeLoops {
118      }
119  
120      static void oneRun(Class klass, int n, int items) throws Exception {
121 <        Deque<Integer> q = (Deque<Integer>)klass.newInstance();
121 >        Deque<Integer> q = (Deque<Integer>) klass.newInstance();
122          LoopHelpers.BarrierTimer timer = new LoopHelpers.BarrierTimer();
123          CyclicBarrier barrier = new CyclicBarrier(n + 1, timer);
124          totalItems = new AtomicInteger(n * items);

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines