180 |
|
* read-locked. The read count is ignored when validating |
181 |
|
* "optimistic" seqlock-reader-style stamps. Because we must use |
182 |
|
* a small finite number of bits (currently 7) for readers, a |
183 |
< |
* supplementary reader overflow word is used when then number of |
183 |
> |
* supplementary reader overflow word is used when the number of |
184 |
|
* readers exceeds the count field. We do this by treating the max |
185 |
|
* reader count value (RBITS) as a spinlock protecting overflow |
186 |
|
* updates. |
310 |
|
private transient int readerOverflow; |
311 |
|
|
312 |
|
/** |
313 |
< |
* Creates a new lock initially in unlocked state. |
313 |
> |
* Creates a new lock, initially in unlocked state. |
314 |
|
*/ |
315 |
|
public StampedLock() { |
316 |
|
state = ORIGIN; |
667 |
|
else if (m == WBIT) { |
668 |
|
if (a != m) |
669 |
|
break; |
670 |
< |
next = state = s + (WBIT + RUNIT); |
670 |
> |
state = next = s + (WBIT + RUNIT); |
671 |
|
readerPrefSignal(); |
672 |
|
return next; |
673 |
|
} |
701 |
|
else if (m == WBIT) { |
702 |
|
if (a != m) |
703 |
|
break; |
704 |
< |
next = state = (s += WBIT) == 0L ? ORIGIN : s; |
704 |
> |
state = next = (s += WBIT) == 0L ? ORIGIN : s; |
705 |
|
readerPrefSignal(); |
706 |
|
return next; |
707 |
|
} |