Skip to content

Commit 6b5cc95

Browse files
committed
fixup to the previous commit
1 parent 44ddd1a commit 6b5cc95

File tree

3 files changed

+13
-13
lines changed

3 files changed

+13
-13
lines changed

kotlinx-coroutines-core/common/src/JobSupport.kt

+1-1
Original file line numberDiff line numberDiff line change
@@ -515,7 +515,7 @@ public open class JobSupport constructor(active: Boolean) : Job, ChildJob, Paren
515515
*/
516516
val latestState = this@JobSupport.state
517517
if (latestState is Finishing) {
518-
// Assumption: children always have `invokeImmediately = true`.
518+
assert { invokeImmediately }
519519
synchronized(latestState) { latestState.rootCause }?.let { handler.invoke(it) }
520520
}
521521
}

kotlinx-coroutines-core/concurrent/src/internal/LockFreeLinkedList.kt

+6-6
Original file line numberDiff line numberDiff line change
@@ -84,8 +84,8 @@ public actual open class LockFreeLinkedListNode {
8484
while (true) { // lock-free loop on prev.next
8585
val currentPrev = prevNode
8686
return when {
87-
currentPrev is LIST_CLOSED_FOR_ALL -> false
88-
currentPrev is LIST_CLOSED_FOR_SOME ->
87+
currentPrev is ListClosedForAll -> false
88+
currentPrev is ListClosedForSome ->
8989
allowedAfterPartialClosing && currentPrev.addLast(node, allowedAfterPartialClosing)
9090
currentPrev.addNext(node, this) -> true
9191
else -> continue
@@ -96,12 +96,12 @@ public actual open class LockFreeLinkedListNode {
9696
/**
9797
* Forbids adding some of the new items to this list.
9898
*/
99-
public actual fun closeForSome() { addLast(LIST_CLOSED_FOR_SOME(), allowedAfterPartialClosing = false) }
99+
public actual fun closeForSome() { addLast(ListClosedForSome(), allowedAfterPartialClosing = false) }
100100

101101
/**
102102
* Forbids adding new items to this list.
103103
*/
104-
public actual fun close() { addLast(LIST_CLOSED_FOR_ALL(), allowedAfterPartialClosing = true) }
104+
public actual fun close() { addLast(ListClosedForAll(), allowedAfterPartialClosing = true) }
105105

106106
/**
107107
* Given:
@@ -291,6 +291,6 @@ public actual open class LockFreeLinkedListHead : LockFreeLinkedListNode() {
291291
override val isRemoved: Boolean get() = false
292292
}
293293

294-
private class LIST_CLOSED_FOR_SOME: LockFreeLinkedListNode()
294+
private class ListClosedForSome: LockFreeLinkedListNode()
295295

296-
private class LIST_CLOSED_FOR_ALL: LockFreeLinkedListNode()
296+
private class ListClosedForAll: LockFreeLinkedListNode()

kotlinx-coroutines-core/jsAndWasmShared/src/internal/LinkedList.kt

+6-6
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,8 @@ public open class LinkedListNode : DisposableHandle {
2323
public inline val isRemoved get() = _removed
2424

2525
public fun addLast(node: Node, allowedAfterPartialClosing: Boolean): Boolean = when (val prev = this._prev) {
26-
is LIST_CLOSED_FOR_ALL -> false
27-
is LIST_CLOSED_FOR_SOME -> allowedAfterPartialClosing && prev.addLast(node, allowedAfterPartialClosing)
26+
is ListClosedForAll -> false
27+
is ListClosedForSome -> allowedAfterPartialClosing && prev.addLast(node, allowedAfterPartialClosing)
2828
else -> {
2929
node._next = this
3030
node._prev = prev
@@ -35,11 +35,11 @@ public open class LinkedListNode : DisposableHandle {
3535
}
3636

3737
public fun closeForSome() {
38-
addLast(LIST_CLOSED_FOR_SOME(), allowedAfterPartialClosing = true)
38+
addLast(ListClosedForSome(), allowedAfterPartialClosing = true)
3939
}
4040

4141
public fun close() {
42-
addLast(LIST_CLOSED_FOR_ALL(), allowedAfterPartialClosing = false)
42+
addLast(ListClosedForAll(), allowedAfterPartialClosing = false)
4343
}
4444

4545
/*
@@ -88,6 +88,6 @@ public open class LinkedListHead : LinkedListNode() {
8888
public final override fun remove(): Nothing = throw UnsupportedOperationException()
8989
}
9090

91-
private class LIST_CLOSED_FOR_SOME: LinkedListNode()
91+
private class ListClosedForSome: LinkedListNode()
9292

93-
private class LIST_CLOSED_FOR_ALL: LinkedListNode()
93+
private class ListClosedForAll: LinkedListNode()

0 commit comments

Comments
 (0)