aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/dotty/runtime/LazyVals.scala2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/dotty/runtime/LazyVals.scala b/src/dotty/runtime/LazyVals.scala
index d662f049a..2aa45e6fd 100644
--- a/src/dotty/runtime/LazyVals.scala
+++ b/src/dotty/runtime/LazyVals.scala
@@ -11,8 +11,8 @@ object LazyVals {
final val BITS_PER_LAZY_VAL = 2
final val LAZY_VAL_MASK = 3
- @inline def CAS(t: Object, offset: Long, e: Long, v: Long, ord: Int) = {
@inline def STATE(cur: Long, ord: Int) = (cur >> (ord * BITS_PER_LAZY_VAL)) & LAZY_VAL_MASK
+ @inline def CAS(t: Object, offset: Long, e: Long, v: Int, ord: Int) = {
val mask = ~(LAZY_VAL_MASK << ord * BITS_PER_LAZY_VAL)
val n = (e & mask) | (v << (ord * BITS_PER_LAZY_VAL))
compareAndSet(t, offset, e, n)