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 {
85
85
}
86
86
87
87
// 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
89
90
90
91
// LINEARIZABLE WHEN THIS NODE IS NOT REMOVED:
91
92
// Returns prev non-removed Node, makes sure prev is correct (prev.next === this)
@@ -323,9 +324,6 @@ private class Removed(@JvmField val ref: Node) {
323
324
override fun toString (): String = " Removed[$ref ]"
324
325
}
325
326
326
- @PublishedApi
327
- internal fun Any.unwrap (): Node = (this as ? Removed )?.ref ? : this as Node
328
-
329
327
/* *
330
328
* Head (sentinel) item of the linked list that is never removed.
331
329
*
You can’t perform that action at this time.
0 commit comments