Skip to content

Commit

Permalink
Fix a typo (#4263)
Browse files Browse the repository at this point in the history
  • Loading branch information
vladd-g authored Oct 30, 2024
1 parent e3536c6 commit a9e8a1e
Showing 1 changed file with 5 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -210,7 +210,7 @@ internal open class CancellableContinuationImpl<in T>(
is Segment<*> -> callSegmentOnCancellation(state, cause)
}
// Complete state update
detachChildIfNonResuable()
detachChildIfNonReusable()
dispatchResume(resumeMode) // no need for additional cancellation checks
return true
}
Expand All @@ -220,7 +220,7 @@ internal open class CancellableContinuationImpl<in T>(
if (cancelLater(cause)) return
cancel(cause)
// Even if cancellation has failed, we should detach child to avoid potential leak
detachChildIfNonResuable()
detachChildIfNonReusable()
}

private inline fun callCancelHandlerSafely(block: () -> Unit) {
Expand Down Expand Up @@ -500,7 +500,7 @@ internal open class CancellableContinuationImpl<in T>(
is NotCompleted -> {
val update = resumedState(state, proposedUpdate, resumeMode, onCancellation, idempotent = null)
if (!_state.compareAndSet(state, update)) return@loop // retry on cas failure
detachChildIfNonResuable()
detachChildIfNonReusable()
dispatchResume(resumeMode) // dispatch resume, but it might get cancelled in process
return // done
}
Expand Down Expand Up @@ -536,7 +536,7 @@ internal open class CancellableContinuationImpl<in T>(
is NotCompleted -> {
val update = resumedState(state, proposedUpdate, resumeMode, onCancellation, idempotent)
if (!_state.compareAndSet(state, update)) return@loop // retry on cas failure
detachChildIfNonResuable()
detachChildIfNonReusable()
return RESUME_TOKEN
}
is CompletedContinuation<*> -> {
Expand All @@ -557,7 +557,7 @@ internal open class CancellableContinuationImpl<in T>(
}

// Unregister from parent job
private fun detachChildIfNonResuable() {
private fun detachChildIfNonReusable() {
// If instance is reusable, do not detach on every reuse, #releaseInterceptedContinuation will do it for us in the end
if (!isReusable()) detachChild()
}
Expand Down

0 comments on commit a9e8a1e

Please sign in to comment.