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

Comparing jsr166/src/test/loops/LockOncePerThreadLoops.java (file contents):
Revision 1.2 by dl, Mon Feb 19 00:46:06 2007 UTC vs.
Revision 1.3 by jsr166, Thu Oct 29 23:09:07 2009 UTC

# Line 17 | Line 17 | public final class LockOncePerThreadLoop
17      static int replications = 20;
18  
19      public static void main(String[] args) throws Exception {
20 <        if (args.length > 0)
20 >        if (args.length > 0)
21              replications = Integer.parseInt(args[0]);
22  
23 <        if (args.length > 1)
23 >        if (args.length > 1)
24              nlocks = Integer.parseInt(args[1]);
25  
26          print = true;
# Line 48 | Line 48 | public final class LockOncePerThreadLoop
48          }
49  
50          final void test() throws Exception {
51 <            for (int i = 0; i < nthreads; ++i)
51 >            for (int i = 0; i < nthreads; ++i)
52                  pool.execute(this);
53              barrier.await();
54              barrier.await();
# Line 65 | Line 65 | public final class LockOncePerThreadLoop
65  
66          public final void run() {
67              try {
68 <                barrier.await();
68 >                barrier.await();
69                  int sum = v;
70                  int x = 0;
71                  for (int i = 0; i < locks.length; ++i) {
# Line 86 | Line 86 | public final class LockOncePerThreadLoop
86                  barrier.await();
87                  result += sum;
88              }
89 <            catch (Exception ie) {
90 <                return;
89 >            catch (Exception ie) {
90 >                return;
91              }
92          }
93      }

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines