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

Comparing jsr166/src/test/loops/LockLoops.java (file contents):
Revision 1.2 by dl, Mon May 9 19:33:30 2005 UTC vs.
Revision 1.3 by jsr166, Thu Oct 29 23:09:07 2009 UTC

# Line 25 | Line 25 | public final class LockLoops {
25          int iters = 1000000;
26          int replications = 1;
27  
28 <        if (args.length > 0)
28 >        if (args.length > 0)
29              maxThreads = Integer.parseInt(args[0]);
30  
31 <        if (args.length > 1)
31 >        if (args.length > 1)
32              iters = Integer.parseInt(args[1]);
33  
34 <        if (args.length > 2)
34 >        if (args.length > 2)
35              replications = Integer.parseInt(args[2]);
36  
37          rng.setSeed(3122688L);
# Line 142 | Line 142 | public final class LockLoops {
142              v = initialValue;
143              this.iters = iters;
144              barrier = new CyclicBarrier(nthreads+1, timer);
145 <            for (int i = 0; i < nthreads; ++i)
145 >            for (int i = 0; i < nthreads; ++i)
146                  pool.execute(this);
147              barrier.await();
148              barrier.await();
# Line 161 | Line 161 | public final class LockLoops {
161          abstract int loop(int n);
162          public final void run() {
163              try {
164 <                barrier.await();
164 >                barrier.await();
165                  result += loop(iters);
166                  barrier.await();
167              }
168 <            catch (Exception ie) {
169 <                return;
168 >            catch (Exception ie) {
169 >                return;
170              }
171          }
172  

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines