File tree Expand file tree Collapse file tree 1 file changed +2
-4
lines changed
kotlinx-coroutines-core/concurrent/src/internal Expand file tree Collapse file tree 1 file changed +2
-4
lines changed Original file line number Diff line number Diff line change @@ -85,7 +85,8 @@ public actual open class LockFreeLinkedListNode {
8585 }
8686
8787 // LINEARIZABLE. Returns next non-removed Node
88- public actual val nextNode: Node get() = next.unwrap()
88+ public actual val nextNode: Node get() =
89+ next.let { (it as ? Removed )?.ref ? : it as Node } // unwraps the `next` node
8990
9091 // LINEARIZABLE WHEN THIS NODE IS NOT REMOVED:
9192 // Returns prev non-removed Node, makes sure prev is correct (prev.next === this)
@@ -323,9 +324,6 @@ private class Removed(@JvmField val ref: Node) {
323324 override fun toString (): String = " Removed[$ref ]"
324325}
325326
326- @PublishedApi
327- internal fun Any.unwrap (): Node = (this as ? Removed )?.ref ? : this as Node
328-
329327/* *
330328 * Head (sentinel) item of the linked list that is never removed.
331329 *
You can’t perform that action at this time.
0 commit comments