Skip to content

Commit 49b6305

Browse files
authored
Clarify docs for CancellableContinuation (Kotlin#800)
Clarify docs for CancellableContinuation Fixes Kotlin#712
1 parent bafe7fb commit 49b6305

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

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

+4-2
Original file line numberDiff line numberDiff line change
@@ -29,8 +29,10 @@ import kotlin.jvm.*
2929
*
3030
* A [cancelled][isCancelled] continuation implies that it is [completed][isCompleted].
3131
*
32-
* Invocation of [resume] or [resumeWithException] in _resumed_ state produces [IllegalStateException]
33-
* but is ignored in _cancelled_ state.
32+
* Invocation of [resume] or [resumeWithException] in _resumed_ state produces [IllegalStateException].
33+
* Invocation of [resume] in _cancelled_ state is ignored (it is a trivial race between resume from the continuation owner and
34+
* outer job cancellation and cancellation wins).
35+
* Invocation of [resumeWithException] in _cancelled_ state triggers exception handling of passed exception.
3436
*
3537
* ```
3638
* +-----------+ resume +---------+

0 commit comments

Comments
 (0)