Skip to content

Commit a1bf13f

Browse files
committed
Let's see how it works :)
1 parent 74d0a78 commit a1bf13f

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

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

+3-3
Original file line numberDiff line numberDiff line change
@@ -224,9 +224,9 @@ internal open class CancellableContinuationImpl<in T>(
224224
callCancelHandlerSafely { handler.invoke(cause) }
225225

226226
fun callSegmentOnCancellation(segment: Segment<*>, cause: Throwable?) {
227-
// val index = _decisionAndIndex.getAndUpdate { construct(it.decision, NO_INDEX) }.index
228-
// check(index != NO_INDEX) { "The index for segment.invokeOnCancellation(..) is broken" }
229-
// callCancelHandlerSafely { segment.invokeOnCancellation(index, cause) }
227+
val index = _decisionAndIndex.value.index
228+
check(index != NO_INDEX) { "The index for segment.invokeOnCancellation(..) is broken" }
229+
callCancelHandlerSafely { segment.invokeOnCancellation(index, cause) }
230230
}
231231

232232

kotlinx-coroutines-core/common/src/internal/ConcurrentLinkedList.kt

+1-1
Original file line numberDiff line numberDiff line change
@@ -187,7 +187,7 @@ internal abstract class ConcurrentLinkedListNode<N : ConcurrentLinkedListNode<N>
187187
* Essentially, this is a node in the Michael-Scott queue algorithm,
188188
* but with maintaining [prev] pointer for efficient [remove] implementation.
189189
*/
190-
internal abstract class Segment<S : Segment<S>>(val id: Long, prev: S?, pointers: Int): ConcurrentLinkedListNode<S>(prev) {
190+
internal abstract class Segment<S : Segment<S>>(val id: Long, prev: S?, pointers: Int): ConcurrentLinkedListNode<S>(prev), NotCompleted {
191191
/**
192192
* This property should return the maximal number of slots in this segment,
193193
* it is used to define whether the segment is logically removed.

0 commit comments

Comments
 (0)