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

Comparing jsr166/src/test/loops/SimpleSpinLockLoops.java (file contents):
Revision 1.1 by dl, Mon May 2 19:19:38 2005 UTC vs.
Revision 1.3 by dl, Mon Feb 19 00:46:06 2007 UTC

# Line 1 | Line 1
1   /*
2 * @test
3 * @synopsis multiple threads using a spinlock
4 */
5 /*
2   * Written by Doug Lea with assistance from members of JCP JSR-166
3 < * Expert Group and released to the public domain. Use, modify, and
4 < * redistribute this code in any way without acknowledgement.
3 > * Expert Group and released to the public domain, as explained at
4 > * http://creativecommons.org/licenses/publicdomain
5   */
6  
7   import java.util.concurrent.*;
# Line 87 | Line 83 | public final class SimpleSpinLockLoops {
83                      if (k > 0) {
84                          x = v;
85                          while (k-- > 0)
86 <                            x = LoopHelpers.compute4(x);
86 >                            x = LoopHelpers.compute6(x);
87                          v = x;
88                      }
89                      else x = sum + 1;
# Line 95 | Line 91 | public final class SimpleSpinLockLoops {
91                      if ((x += readBarrier) == 0)
92                          ++readBarrier;
93                      for (int l = x & 1; l > 0; --l)
94 <                        sum += LoopHelpers.compute4(sum);
94 >                        sum += LoopHelpers.compute6(sum);
95                  }
96                  barrier.await();
97                  result += sum;

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines