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

Comparing jsr166/src/test/loops/ConcurrentQueueLoops.java (file contents):
Revision 1.8 by jsr166, Mon Nov 2 23:42:46 2009 UTC vs.
Revision 1.12 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 67 | Line 67 | public class ConcurrentQueueLoops {
67          final Queue<Integer> queue;
68          final CyclicBarrier barrier;
69          final int nthreads;
70 <        Stage (Queue<Integer> q, CyclicBarrier b, int nthreads) {
70 >        Stage(Queue<Integer> q, CyclicBarrier b, int nthreads) {
71              queue = q;
72              barrier = b;
73              this.nthreads = nthreads;
# Line 75 | Line 75 | public class ConcurrentQueueLoops {
75  
76          static int compute(int l) {
77              if (l == 0)
78 <                return (int)System.nanoTime();
78 >                return (int) System.nanoTime();
79              int nn =  (l >>> 7) & workMask;
80              while (nn-- > 0)
81                  l = LoopHelpers.compute6(l);
# Line 87 | Line 87 | public class ConcurrentQueueLoops {
87                  barrier.await();
88                  long now = System.nanoTime();
89                  long stopTime = now + RUN_TIME_NANOS;
90 <                int l = (int)now;
90 >                int l = (int) now;
91                  int takes = 0;
92                  int misses = 0;
93                  int lmask = 1;
# Line 118 | Line 118 | public class ConcurrentQueueLoops {
118      }
119  
120      static void oneRun(Class klass, int n) throws Exception {
121 <        Queue<Integer> q = (Queue<Integer>)klass.newInstance();
121 >        Queue<Integer> q = (Queue<Integer>) klass.newInstance();
122          LoopHelpers.BarrierTimer timer = new LoopHelpers.BarrierTimer();
123          CyclicBarrier barrier = new CyclicBarrier(n + 1, timer);
124          ArrayList<Future<Integer>> results = new ArrayList<Future<Integer>>(n);

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines