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.3 by jsr166, Fri Oct 12 16:27:05 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;
# Line 1019 | Line 1019 | public class StampedLock implements java
1019              }
1020          }
1021          writerPrefSignal();
1022 <        return (interrupted || Thread.interrupted())? INTERRUPTED : 0L;
1022 >        return (interrupted || Thread.interrupted()) ? INTERRUPTED : 0L;
1023      }
1024  
1025      /*
# Line 1127 | Line 1127 | public class StampedLock implements java
1127              }
1128          }
1129          readerPrefSignal();
1130 <        return (interrupted || Thread.interrupted())? INTERRUPTED : 0L;
1130 >        return (interrupted || Thread.interrupted()) ? INTERRUPTED : 0L;
1131      }
1132  
1133      // Unsafe mechanics
# Line 1201 | Line 1201 | public class StampedLock implements java
1201      }
1202  
1203   }
1204

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines