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

Comparing jsr166/src/test/loops/TimeoutLockLoops.java (file contents):
Revision 1.1 by dl, Mon May 2 19:19:38 2005 UTC vs.
Revision 1.6 by jsr166, Tue Mar 15 19:47:06 2011 UTC

# Line 1 | Line 1
1   /*
2 < * @test %I% %E%
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/publicdomain/zero/1.0/
5 > */
6 > /*
7 > * @test
8   * @bug 4486658
9   * @compile -source 1.5 TimeoutLockLoops.java
10   * @run main TimeoutLockLoops
# Line 18 | Line 23 | public final class TimeoutLockLoops {
23      static final LoopHelpers.SimpleRandom rng = new LoopHelpers.SimpleRandom();
24      static boolean print = false;
25      static final int ITERS = Integer.MAX_VALUE;
26 <    static final long TIMEOUT = 100;
26 >    static final long TIMEOUT = 100;
27  
28      public static void main(String[] args) throws Exception {
29          int maxThreads = 100;
30 <        if (args.length > 0)
30 >        if (args.length > 0)
31              maxThreads = Integer.parseInt(args[0]);
32  
33          print = true;
# Line 61 | Line 66 | public final class TimeoutLockLoops {
66              barrier.await();
67              if (print) {
68                  long time = timer.getTime();
69 <                double secs = (double)(time) / 1000000000.0;
69 >                double secs = (double) time / 1000000000.0;
70                  System.out.println("\t " + secs + "s run time");
71              }
72  
# Line 74 | Line 79 | public final class TimeoutLockLoops {
79  
80          public final void run() {
81              try {
82 <                barrier.await();
82 >                barrier.await();
83                  int sum = v;
84                  int x = 17;
85                  int n = ITERS;
# Line 99 | Line 104 | public final class TimeoutLockLoops {
104                  barrier.await();
105                  result += sum;
106              }
107 <            catch (Exception ex) {
107 >            catch (Exception ex) {
108                  ex.printStackTrace();
109 <                return;
109 >                return;
110              }
111          }
112      }

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines