File tree 1 file changed +7
-3
lines changed
kotlinx-coroutines-core/common/src
1 file changed +7
-3
lines changed Original file line number Diff line number Diff line change @@ -42,11 +42,15 @@ public fun SupervisorJob0(parent: Job? = null) : Job = SupervisorJob(parent)
42
42
* Creates a [CoroutineScope] with [SupervisorJob] and calls the specified suspend block with this scope.
43
43
* The provided scope inherits its [coroutineContext][CoroutineScope.coroutineContext] from the outer scope, but overrides
44
44
* context's [Job] with [SupervisorJob].
45
+ * This function returns as soon as the given block and all its child coroutines are completed.
45
46
*
46
- * A failure of a child does not cause this scope to fail and does not affect its other children,
47
- * so a custom policy for handling failures of its children can be implemented. See [SupervisorJob] for details.
48
- * A failure of the scope itself (exception thrown in the [block] or cancellation) fails the scope with all its children,
47
+ * Unlike [coroutineScope], a failure of a child does not cause this scope to fail and does not affect its other children,
48
+ * so a custom policy for handling failures of its children can be implemented. See [SupervisorJob] for additional details.
49
+ * A failure of the scope itself (exception thrown in the [block] or external cancellation) fails the scope with all its children,
49
50
* but does not cancel parent job.
51
+ *
52
+ * The method may throw a [CancellationException] if the current job was cancelled externally,
53
+ * or rethrow an exception thrown by the given [block].
50
54
*/
51
55
public suspend fun <R > supervisorScope (block : suspend CoroutineScope .() -> R ): R {
52
56
contract {
You can’t perform that action at this time.
0 commit comments