Skip to content

Commit 7ae273c

Browse files
authored
Fix wrong docs on Job.join (#2616)
* Fix wrong docs on Job.join and Job.cancelAndJoin Fixes #2615
1 parent ea039ea commit 7ae273c

File tree

1 file changed

+6
-6
lines changed
  • kotlinx-coroutines-core/common/src

1 file changed

+6
-6
lines changed

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

+6-6
Original file line numberDiff line numberDiff line change
@@ -252,9 +252,9 @@ public interface Job : CoroutineContext.Element {
252252
* suspending function is invoked or while it is suspended, this function
253253
* throws [CancellationException].
254254
*
255-
* In particular, it means that a parent coroutine invoking `join` on a child coroutine that was started using
256-
* `launch(coroutineContext) { ... }` builder throws [CancellationException] if the child
257-
* had crashed, unless a non-standard [CoroutineExceptionHandler] is installed in the context.
255+
* In particular, it means that a parent coroutine invoking `join` on a child coroutine throws
256+
* [CancellationException] if the child had failed, since a failure of a child coroutine cancels parent by default,
257+
* unless the child was launched from within [supervisorScope].
258258
*
259259
* This function can be used in [select] invocation with [onJoin] clause.
260260
* Use [isCompleted] to check for a completion of this job without waiting.
@@ -498,9 +498,9 @@ internal fun Job.disposeOnCompletion(handle: DisposableHandle): DisposableHandle
498498
* suspending function is invoked or while it is suspended, this function
499499
* throws [CancellationException].
500500
*
501-
* In particular, it means that a parent coroutine invoking `cancelAndJoin` on a child coroutine that was started using
502-
* `launch(coroutineContext) { ... }` builder throws [CancellationException] if the child
503-
* had crashed, unless a non-standard [CoroutineExceptionHandler] is installed in the context.
501+
* In particular, it means that a parent coroutine invoking `cancelAndJoin` on a child coroutine throws
502+
* [CancellationException] if the child had failed, since a failure of a child coroutine cancels parent by default,
503+
* unless the child was launched from within [supervisorScope].
504504
*
505505
* This is a shortcut for the invocation of [cancel][Job.cancel] followed by [join][Job.join].
506506
*/

0 commit comments

Comments
 (0)