You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Tweaked order of notifications for better error handling & consistency
* JobSupport.onCompletionInternal(onCompleted/onCancelled) is now invoked
before all the user-installed listeners with is consistent with how
the onCancelling/invokeOnCancelling(onCancelling=true) works.
* Now all the state processing (updating the future, reporting unhandled
exception, etc) in onCompletionInternal happens before observers that
.join/.wait the coroutine are resumed and even before the state is set
to final (to avoid exception handing races) with the exception of
fast-path successful completion of coroutine.
* JobSupport.afterCompletionInternal is introduced. It is invoked
after all use-installed listeners and that is where scoped coroutines
resume the rest of the code.
* Remove empty AbstractCoroutine.onCancellation, move docs to JobSupport
* onCancellation renamed to onCancelling for consistency with
invokeOnCompletion(onCancelling=true)
Copy file name to clipboardExpand all lines: binary-compatibility-validator/reference-public-api/kotlinx-coroutines-core.txt
+4-2Lines changed: 4 additions & 2 deletions
Original file line number
Diff line number
Diff line change
@@ -5,9 +5,9 @@ public abstract class kotlinx/coroutines/AbstractCoroutine : kotlinx/coroutines/
5
5
public final fun getContext ()Lkotlin/coroutines/CoroutineContext;
6
6
public fun getCoroutineContext ()Lkotlin/coroutines/CoroutineContext;
7
7
public fun isActive ()Z
8
-
protected fun onCancellation (Ljava/lang/Throwable;)V
9
8
protected fun onCancelled (Ljava/lang/Throwable;Z)V
10
9
protected fun onCompleted (Ljava/lang/Object;)V
10
+
protected final fun onCompletionInternal (Ljava/lang/Object;)V
11
11
protected fun onStart ()V
12
12
public final fun resumeWith (Ljava/lang/Object;)V
13
13
public final fun start (Lkotlinx/coroutines/CoroutineStart;Ljava/lang/Object;Lkotlin/jvm/functions/Function2;)V
@@ -368,6 +368,7 @@ public final class kotlinx/coroutines/JobKt {
368
368
369
369
public class kotlinx/coroutines/JobSupport : kotlinx/coroutines/ChildJob, kotlinx/coroutines/Job, kotlinx/coroutines/ParentJob, kotlinx/coroutines/selects/SelectClause0 {
370
370
public fun <init> (Z)V
371
+
protected fun afterCompletionInternal (Ljava/lang/Object;I)V
371
372
public final fun attachChild (Lkotlinx/coroutines/ChildJob;)Lkotlinx/coroutines/ChildHandle;
372
373
public synthetic fun cancel ()V
373
374
public synthetic fun cancel (Ljava/lang/Throwable;)Z
@@ -396,7 +397,8 @@ public class kotlinx/coroutines/JobSupport : kotlinx/coroutines/ChildJob, kotlin
396
397
public final fun isCompletedExceptionally ()Z
397
398
public final fun join (Lkotlin/coroutines/Continuation;)Ljava/lang/Object;
398
399
public fun minusKey (Lkotlin/coroutines/CoroutineContext$Key;)Lkotlin/coroutines/CoroutineContext;
399
-
protected fun onCancellation (Ljava/lang/Throwable;)V
400
+
protected fun onCancelling (Ljava/lang/Throwable;)V
401
+
protected fun onCompletionInternal (Ljava/lang/Object;)V
400
402
public final fun parentCancelled (Lkotlinx/coroutines/ParentJob;)V
401
403
public fun plus (Lkotlin/coroutines/CoroutineContext;)Lkotlin/coroutines/CoroutineContext;
402
404
public fun plus (Lkotlinx/coroutines/Job;)Lkotlinx/coroutines/Job;
0 commit comments