Skip to content

Commit d808f9e

Browse files
authored
Fix documentation comments in CancellableContinutation.kt (#4447)
- Correct minor grammatical issues - Fix typo - Ensure consistent terminology
1 parent 2530b68 commit d808f9e

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

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

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ import kotlin.coroutines.intrinsics.*
1919
* An instance of `CancellableContinuation` can only be obtained by the [suspendCancellableCoroutine] function.
2020
* The interface itself is public for use and private for implementation.
2121
*
22-
* A typical usages of this function is to suspend a coroutine while waiting for a result
22+
* A typical usage of this function is to suspend a coroutine while waiting for a result
2323
* from a callback or an external source of values that optionally supports cancellation:
2424
*
2525
* ```
@@ -45,7 +45,7 @@ import kotlin.coroutines.intrinsics.*
4545
* [CancellableContinuation] allows concurrent invocations of the [cancel] and [resume] pair, guaranteeing
4646
* that only one of these operations will succeed.
4747
* Concurrent invocations of [resume] methods lead to a [IllegalStateException] and are considered a programmatic error.
48-
* Concurrent invocations of [cancel] methods is permitted, and at most one of them succeeds.
48+
* Concurrent invocations of [cancel] methods are permitted, and at most one of them succeeds.
4949
*
5050
* ### Prompt cancellation guarantee
5151
*
@@ -84,11 +84,11 @@ import kotlin.coroutines.intrinsics.*
8484
*
8585
* A cancellable continuation has three observable states:
8686
*
87-
* | **State** | [isActive] | [isCompleted] | [isCancelled] |
88-
* | ----------------------------------- | ---------- | ------------- | ------------- |
89-
* | _Active_ (initial state) | `true` | `false` | `false` |
90-
* | _Resumed_ (final _completed_ state) | `false` | `true` | `false` |
91-
* | _Canceled_ (final _completed_ state)| `false` | `true` | `true` |
87+
* | **State** | [isActive] | [isCompleted] | [isCancelled] |
88+
* | ------------------------------------ | ---------- | ------------- | ------------- |
89+
* | _Active_ (initial state) | `true` | `false` | `false` |
90+
* | _Resumed_ (final _completed_ state) | `false` | `true` | `false` |
91+
* | _Cancelled_ (final _completed_ state)| `false` | `true` | `true` |
9292
*
9393
* For a detailed description of each state, see the corresponding properties' documentation.
9494
*
@@ -188,7 +188,7 @@ public interface CancellableContinuation<in T> : Continuation<T> {
188188
* Internal function that setups cancellation behavior in [suspendCancellableCoroutine].
189189
* It's illegal to call this function in any non-`kotlinx.coroutines` code and
190190
* such calls lead to undefined behaviour.
191-
* Exposed in our ABI since 1.0.0 withing `suspendCancellableCoroutine` body.
191+
* Exposed in our ABI since 1.0.0 within `suspendCancellableCoroutine` body.
192192
*
193193
* @suppress **This is unstable API and it is subject to change.**
194194
*/

0 commit comments

Comments
 (0)