File tree Expand file tree Collapse file tree 1 file changed +2
-1
lines changed
kotlinx-coroutines-core/common/src/internal Expand file tree Collapse file tree 1 file changed +2
-1
lines changed Original file line number Diff line number Diff line change @@ -145,6 +145,7 @@ internal open class LockFreeLinkedListSegment(
145
145
fun tryAdd (node : LockFreeLinkedListNode , permissionsBitmask : Byte , indexInSegment : Int ): Boolean {
146
146
if (cells[indexInSegment].compareAndSet(null , node)) return true
147
147
cells[indexInSegment].loop { value ->
148
+ val valueAsAny: Any? = value // explicitly remember the boxed value; the type must be explicitly written
148
149
// This means that some elements are forbidden from entering the list.
149
150
value as BrokenForSomeElements
150
151
// Are *we* forbidden from entering the list?
@@ -154,7 +155,7 @@ internal open class LockFreeLinkedListSegment(
154
155
return false
155
156
}
156
157
// We aren't forbidden. Let's try entering it.
157
- if (cells[indexInSegment].compareAndSet(value , node)) return true
158
+ if (cells[indexInSegment].compareAndSet(valueAsAny , node)) return true
158
159
}
159
160
}
160
161
You can’t perform that action at this time.
0 commit comments