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

Comparing jsr166/src/jsr166e/StampedLock.java (file contents):
Revision 1.1 by dl, Fri Oct 12 14:09:30 2012 UTC vs.
Revision 1.2 by jsr166, Fri Oct 12 16:22:40 2012 UTC

# Line 673 | Line 673 | public class StampedLock implements java
673       */
674      public long tryConvertToOptimisticRead(long stamp) {
675          long a = stamp & ABITS, m, s, next;
676 <        while (((s = U.getLongVolatile(this, STATE)) &
676 >        while (((s = U.getLongVolatile(this, STATE)) &
677                  SBITS) == (stamp & SBITS)) {
678              if ((m = s & ABITS) == 0L) {
679                  if (a != 0L)
# Line 784 | Line 784 | public class StampedLock implements java
784                  return s;
785              }
786          }
787 <        else if ((ThreadLocalRandom.current().nextInt() &
787 >        else if ((ThreadLocalRandom.current().nextInt() &
788                    OVERFLOW_YIELD_RATE) == 0)
789              Thread.yield();
790          return 0L;
# Line 809 | Line 809 | public class StampedLock implements java
809                   return next;
810              }
811          }
812 <        else if ((ThreadLocalRandom.current().nextInt() &
812 >        else if ((ThreadLocalRandom.current().nextInt() &
813                    OVERFLOW_YIELD_RATE) == 0)
814              Thread.yield();
815          return 0L;

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines