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) |
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; |
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; |