@@ -16,27 +16,8 @@ public expect open class LockFreeLinkedListNode() {
16
16
public fun addLast (node : LockFreeLinkedListNode )
17
17
public fun addOneIfEmpty (node : LockFreeLinkedListNode ): Boolean
18
18
public inline fun addLastIf (node : LockFreeLinkedListNode , crossinline condition : () -> Boolean ): Boolean
19
- public inline fun addLastIfPrev (
20
- node : LockFreeLinkedListNode ,
21
- predicate : (LockFreeLinkedListNode ) -> Boolean
22
- ): Boolean
23
-
24
- public inline fun addLastIfPrevAndIf (
25
- node : LockFreeLinkedListNode ,
26
- predicate : (LockFreeLinkedListNode ) -> Boolean , // prev node predicate
27
- crossinline condition : () -> Boolean // atomically checked condition
28
- ): Boolean
29
-
30
19
public open fun remove (): Boolean
31
20
32
- /* *
33
- * Helps fully finish [remove] operation, must be invoked after [remove] if needed.
34
- * Ensures that traversing the list via prev pointers sees this node as removed.
35
- * No-op on JS
36
- */
37
- public fun helpRemove ()
38
- public fun removeFirstOrNull (): LockFreeLinkedListNode ?
39
- public inline fun <reified T > removeFirstIfIsInstanceOfOrPeekIf (predicate : (T ) -> Boolean ): T ?
40
21
}
41
22
42
23
/* * @suppress **This is unstable API and it is subject to change.** */
@@ -45,45 +26,3 @@ public expect open class LockFreeLinkedListHead() : LockFreeLinkedListNode {
45
26
public inline fun <reified T : LockFreeLinkedListNode > forEach (block : (T ) -> Unit )
46
27
public final override fun remove (): Nothing
47
28
}
48
-
49
- /* * @suppress **This is unstable API and it is subject to change.** */
50
- public expect open class AddLastDesc <T : LockFreeLinkedListNode >(
51
- queue : LockFreeLinkedListNode ,
52
- node : T
53
- ) : AbstractAtomicDesc {
54
- val queue: LockFreeLinkedListNode
55
- val node: T
56
- override fun finishPrepare (prepareOp : PrepareOp )
57
- override fun finishOnSuccess (affected : LockFreeLinkedListNode , next : LockFreeLinkedListNode )
58
- }
59
-
60
- /* * @suppress **This is unstable API and it is subject to change.** */
61
- public expect open class RemoveFirstDesc <T >(queue : LockFreeLinkedListNode ): AbstractAtomicDesc {
62
- val queue: LockFreeLinkedListNode
63
- public val result: T
64
- override fun finishPrepare (prepareOp : PrepareOp )
65
- final override fun finishOnSuccess (affected : LockFreeLinkedListNode , next : LockFreeLinkedListNode )
66
- }
67
-
68
- /* * @suppress **This is unstable API and it is subject to change.** */
69
- public expect abstract class AbstractAtomicDesc : AtomicDesc {
70
- final override fun prepare (op : AtomicOp <* >): Any?
71
- final override fun complete (op : AtomicOp <* >, failure : Any? )
72
- protected open fun failure (affected : LockFreeLinkedListNode ): Any?
73
- protected open fun retry (affected : LockFreeLinkedListNode , next : Any ): Boolean
74
- public abstract fun finishPrepare (prepareOp : PrepareOp ) // non-null on failure
75
- public open fun onPrepare (prepareOp : PrepareOp ): Any? // non-null on failure
76
- public open fun onRemoved (affected : LockFreeLinkedListNode ) // non-null on failure
77
- protected abstract fun finishOnSuccess (affected : LockFreeLinkedListNode , next : LockFreeLinkedListNode )
78
- }
79
-
80
- /* * @suppress **This is unstable API and it is subject to change.** */
81
- public expect class PrepareOp : OpDescriptor {
82
- val affected: LockFreeLinkedListNode
83
- override val atomicOp: AtomicOp <* >
84
- val desc: AbstractAtomicDesc
85
- fun finishPrepare ()
86
- }
87
-
88
- @JvmField
89
- internal val REMOVE_PREPARED : Any = Symbol (" REMOVE_PREPARED" )
0 commit comments