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.29 by dl, Wed Jan 23 17:29:18 2013 UTC vs.
Revision 1.30 by jsr166, Thu Jan 24 04:10:44 2013 UTC

# Line 232 | Line 232 | public class StampedLock implements java
232       *
233       * Nearly all of these mechanics are carried out in methods
234       * acquireWrite and acquireRead, that, as typical of such code,
235 <     * sprawl out because actions and retries rely on consitent sets
235 >     * sprawl out because actions and retries rely on consistent sets
236       * of locally cached reads.
237       *
238       * As noted in Boehm's paper (above), sequence validation (mainly
# Line 331 | Line 331 | public class StampedLock implements java
331       * @return a stamp that can be used to unlock or convert mode
332       */
333      public long writeLock() {
334 <        long s, next;  // bypass acquireWrite in fully onlocked case only
334 >        long s, next;  // bypass acquireWrite in fully unlocked case only
335          return ((((s = state) & ABITS) == 0L &&
336                   U.compareAndSwapLong(this, STATE, s, next = s + WBIT)) ?
337                  next : acquireWrite(false, 0L));
# Line 403 | Line 403 | public class StampedLock implements java
403       * @return a stamp that can be used to unlock or convert mode
404       */
405      public long readLock() {
406 <        long s, next;  // bypass acquireRead on fully onlocked case only
406 >        long s, next;  // bypass acquireRead on fully unlocked case only
407          return ((((s = state) & ABITS) == 0L &&
408                   U.compareAndSwapLong(this, STATE, s, next = s + RUNIT)) ?
409                  next : acquireRead(false, 0L));

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines