From 9530760ef07bb40df917c230f1b2048f04cfe6ba Mon Sep 17 00:00:00 2001 From: Vsevolod Tolstopyatov Date: Thu, 2 Sep 2021 14:15:58 +0300 Subject: [PATCH] Update CoroutineScope() factory documentation (#2892) * Update CoroutineScope() factory documentation Fixes #2891 --- kotlinx-coroutines-core/common/src/CoroutineScope.kt | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/kotlinx-coroutines-core/common/src/CoroutineScope.kt b/kotlinx-coroutines-core/common/src/CoroutineScope.kt index 3ed233bfb9..21d2a6e000 100644 --- a/kotlinx-coroutines-core/common/src/CoroutineScope.kt +++ b/kotlinx-coroutines-core/common/src/CoroutineScope.kt @@ -12,7 +12,7 @@ import kotlin.coroutines.* import kotlin.coroutines.intrinsics.* /** - * Defines a scope for new coroutines. Every **coroutine builder** (like [launch], [async], etc) + * Defines a scope for new coroutines. Every **coroutine builder** (like [launch], [async], etc.) * is an extension on [CoroutineScope] and inherits its [coroutineContext][CoroutineScope.coroutineContext] * to automatically propagate all its elements and cancellation. * @@ -28,8 +28,8 @@ import kotlin.coroutines.intrinsics.* * By convention, the [context of a scope][CoroutineScope.coroutineContext] should contain an instance of a * [job][Job] to enforce the discipline of **structured concurrency** with propagation of cancellation. * - * Every coroutine builder (like [launch], [async], etc) - * and every scoping function (like [coroutineScope], [withContext], etc) provides _its own_ scope + * Every coroutine builder (like [launch], [async], and others) + * and every scoping function (like [coroutineScope] and [withContext]) provides _its own_ scope * with its own [Job] instance into the inner block of code it runs. * By convention, they all wait for all the coroutines inside their block to complete before completing themselves, * thus enforcing the structured concurrency. See [Job] documentation for more details. @@ -269,8 +269,8 @@ public suspend fun coroutineScope(block: suspend CoroutineScope.() -> R): R * Creates a [CoroutineScope] that wraps the given coroutine [context]. * * If the given [context] does not contain a [Job] element, then a default `Job()` is created. - * This way, cancellation or failure of any child coroutine in this scope cancels all the other children, - * just like inside [coroutineScope] block. + * This way, failure of any child coroutine in this scope or [cancellation][CoroutineScope.cancel] of the scope itself + * cancels all the scope's children, just like inside [coroutineScope] block. */ @Suppress("FunctionName") public fun CoroutineScope(context: CoroutineContext): CoroutineScope =