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

Comparing jsr166/src/test/loops/MapLoops.java (file contents):
Revision 1.6 by jsr166, Tue Nov 3 01:04:02 2009 UTC vs.
Revision 1.10 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.*;
# Line 58 | Line 58 | public class MapLoops {
58          System.out.print(" ops: " + nops);
59          System.out.println();
60  
61        int k = 1;
61          int warmups = 2;
62 <        for (int i = 1; i <= maxThreads;) {
62 >        for (int k = 1, i = 1; i <= maxThreads;) {
63              Thread.sleep(100);
64              test(i, nkeys, mapClass);
65              if (warmups > 0)
# Line 127 | Line 126 | public class MapLoops {
126          int position;
127          int total;
128  
129 <        Runner(int id, Map<Integer,Integer> map, Integer[] key,  CyclicBarrier barrier) {
129 >        Runner(int id, Map<Integer,Integer> map, Integer[] key, CyclicBarrier barrier) {
130              this.map = map;
131              this.key = key;
132              this.barrier = barrier;
# Line 137 | Line 136 | public class MapLoops {
136          }
137  
138          int step() {
139 <            // random-walk around key positions,  bunching accesses
139 >            // random-walk around key positions, bunching accesses
140              int r = rng.next();
141              position += (r & 7) - 3;
142              while (position >= key.length) position -= key.length;

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines