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
* Merge onStartInternal and onStart to reduce the number of methods and make code a bit simpler
* Rework initParentJob
* Always establish a parent-child relationship when creating a subclass of AbstractCoroutine. That's our own internal class that we have full control of and it never has a chance to leak to the user-code (so cancellation handlers will be installed etc.). Force implementors of AbstractCoroutine deliberately choose whether parent-child relationship should be established
* As a consequence, get rid of parentContext in all our coroutine classes that are not ScopeCoroutine
* Remove some dead code
* Get rid of an additional parent field from ScopeCoroutine
Leverage already presented information in our implementation, just expose it via an already present internal interface
Copy file name to clipboardExpand all lines: kotlinx-coroutines-core/api/kotlinx-coroutines-core.api
+5-5
Original file line number
Diff line number
Diff line change
@@ -1,7 +1,5 @@
1
1
public abstract class kotlinx/coroutines/AbstractCoroutine : kotlinx/coroutines/JobSupport, kotlin/coroutines/Continuation, kotlinx/coroutines/CoroutineScope, kotlinx/coroutines/Job {
2
-
protected final field parentContext Lkotlin/coroutines/CoroutineContext;
3
-
public fun <init> (Lkotlin/coroutines/CoroutineContext;Z)V
4
-
public synthetic fun <init> (Lkotlin/coroutines/CoroutineContext;ZILkotlin/jvm/internal/DefaultConstructorMarker;)V
2
+
public fun <init> (Lkotlin/coroutines/CoroutineContext;ZZ)V
5
3
protected fun afterResume (Ljava/lang/Object;)V
6
4
protected fun cancellationExceptionMessage ()Ljava/lang/String;
7
5
public final fun getContext ()Lkotlin/coroutines/CoroutineContext;
@@ -10,10 +8,8 @@ public abstract class kotlinx/coroutines/AbstractCoroutine : kotlinx/coroutines/
10
8
protected fun onCancelled (Ljava/lang/Throwable;Z)V
11
9
protected fun onCompleted (Ljava/lang/Object;)V
12
10
protected final fun onCompletionInternal (Ljava/lang/Object;)V
13
-
protected fun onStart ()V
14
11
public final fun resumeWith (Ljava/lang/Object;)V
15
12
public final fun start (Lkotlinx/coroutines/CoroutineStart;Ljava/lang/Object;Lkotlin/jvm/functions/Function2;)V
16
-
public final fun start (Lkotlinx/coroutines/CoroutineStart;Lkotlin/jvm/functions/Function1;)V
17
13
}
18
14
19
15
public final class kotlinx/coroutines/AwaitKt {
@@ -89,6 +85,7 @@ public final class kotlinx/coroutines/CancellableContinuationKt {
89
85
90
86
public abstract interface class kotlinx/coroutines/ChildHandle : kotlinx/coroutines/DisposableHandle {
91
87
public abstract fun childCancelled (Ljava/lang/Throwable;)Z
88
+
public abstract fun getParent ()Lkotlinx/coroutines/Job;
92
89
}
93
90
94
91
public abstract interface class kotlinx/coroutines/ChildJob : kotlinx/coroutines/Job {
@@ -420,6 +417,7 @@ public class kotlinx/coroutines/JobSupport : kotlinx/coroutines/ChildJob, kotlin
420
417
public final fun getKey ()Lkotlin/coroutines/CoroutineContext$Key;
421
418
public final fun getOnJoin ()Lkotlinx/coroutines/selects/SelectClause0;
422
419
protected fun handleJobException (Ljava/lang/Throwable;)Z
420
+
protected final fun initParentJob (Lkotlinx/coroutines/Job;)V
423
421
public final fun invokeOnCompletion (Lkotlin/jvm/functions/Function1;)Lkotlinx/coroutines/DisposableHandle;
424
422
public final fun invokeOnCompletion (ZZLkotlin/jvm/functions/Function1;)Lkotlinx/coroutines/DisposableHandle;
425
423
public fun isActive ()Z
@@ -431,6 +429,7 @@ public class kotlinx/coroutines/JobSupport : kotlinx/coroutines/ChildJob, kotlin
431
429
public fun minusKey (Lkotlin/coroutines/CoroutineContext$Key;)Lkotlin/coroutines/CoroutineContext;
432
430
protected fun onCancelling (Ljava/lang/Throwable;)V
433
431
protected fun onCompletionInternal (Ljava/lang/Object;)V
432
+
protected fun onStart ()V
434
433
public final fun parentCancelled (Lkotlinx/coroutines/ParentJob;)V
435
434
public fun plus (Lkotlin/coroutines/CoroutineContext;)Lkotlin/coroutines/CoroutineContext;
436
435
public fun plus (Lkotlinx/coroutines/Job;)Lkotlinx/coroutines/Job;
@@ -473,6 +472,7 @@ public final class kotlinx/coroutines/NonDisposableHandle : kotlinx/coroutines/C
473
472
public static final field INSTANCE Lkotlinx/coroutines/NonDisposableHandle;
474
473
public fun childCancelled (Ljava/lang/Throwable;)Z
0 commit comments