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

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

# Line 31 | Line 31 | public class TimeoutExchangerLoops {
31                  patienceNanos = Long.parseLong(args[argc]);
32              else if (option.equals("-r"))
33                  nReps = Integer.parseInt(args[argc]);
34 <            else
34 >            else
35                  maxThreads = Integer.parseInt(option);
36              argc++;
37          }
# Line 73 | Line 73 | public class TimeoutExchangerLoops {
73          }
74      }
75  
76 <    static void oneRun(int nThreads, long trialMillis, long patienceNanos)
76 >    static void oneRun(int nThreads, long trialMillis, long patienceNanos)
77          throws Exception {
78          System.out.printf("%4d threads", nThreads);
79          System.out.printf("%9dms", trialMillis);
# Line 89 | Line 89 | public class TimeoutExchangerLoops {
89          long startTime = System.nanoTime();
90          start.countDown();
91          Thread.sleep(trialMillis);
92 <        for (int i = 0; i < nThreads; ++i)
92 >        for (int i = 0; i < nThreads; ++i)
93              threads[i].interrupt();
94          long elapsed = System.nanoTime() - startTime;
95 <        for (int i = 0; i < nThreads; ++i)
95 >        for (int i = 0; i < nThreads; ++i)
96              threads[i].join();
97          int iters = 0;
98          long fails = 0;
# Line 153 | Line 153 | public class TimeoutExchangerLoops {
153          }
154      }
155   }
156        

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines