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

Comparing jsr166/src/test/loops/ContextSwitchTest.java (file contents):
Revision 1.3 by dl, Thu Sep 15 16:55:40 2005 UTC vs.
Revision 1.4 by jsr166, Thu Oct 29 23:09:07 2009 UTC

# Line 31 | Line 31 | public final class ContextSwitchTest {
31          b.join();
32          long endTime = System.nanoTime();
33          int np = a.nparks + b.nparks;
34 <        System.out.println("Average time: " +
34 >        System.out.println("Average time: " +
35                             ((endTime - startTime) / np) +
36                             "ns");
37      }
# Line 43 | Line 43 | public final class ContextSwitchTest {
43          public void run() {
44              final AtomicReference t = turn;
45              final Thread other = this.other;
46 <            if (turn == null || other == null)
46 >            if (turn == null || other == null)
47                  throw new NullPointerException();
48              int p = 0;
49              for (int i = 0; i < iters; ++i) {
# Line 56 | Line 56 | public final class ContextSwitchTest {
56              LockSupport.unpark(other);
57              nparks = p;
58              System.out.println("parks: " + p);
59 <            
59 >
60          }
61      }
62   }
63
64

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines