Skip to content

Commit 4da16c9

Browse files
committed
Migrate to Kotlin 1.3 coroutines, drop experimental from package
* Uses Kotlin version 1.3-M2 * Uses Kotlin/Native version 0.9
1 parent 75cfc4f commit 4da16c9

File tree

538 files changed

+3142
-3067
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

538 files changed

+3142
-3067
lines changed

CHANGES.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -535,7 +535,7 @@
535535
## Version 0.11-rc
536536

537537
* `select` expression with onJoin/onAwait/onSend/onReceive clauses.
538-
* `Mutex` is moved to `kotlinx.coroutines.experimental.sync` package.
538+
* `Mutex` is moved to `kotlinx.coroutines.sync` package.
539539
* `ClosedSendChannelException` is a subclass of `CancellationException` now.
540540
* New sections on "Shared mutable state and concurrency" and "Select expression"
541541
in [coroutines guide](coroutines-guide.md).

README.md

+4-4
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
[![Download](https://api.bintray.com/packages/kotlin/kotlinx/kotlinx.coroutines/images/download.svg?version=0.26.0) ](https://bintray.com/kotlin/kotlinx/kotlinx.coroutines/0.26.0)
66

77
Library support for Kotlin coroutines with [multiplatform](#multiplatform) support.
8-
This is a companion version for Kotlin 1.2.61 release.
8+
This is a companion version for Kotlin 1.3-M2 release.
99

1010
```kotlin
1111
GlobalScope.launch {
@@ -71,7 +71,7 @@ And make sure that you use the latest Kotlin version:
7171

7272
```xml
7373
<properties>
74-
<kotlin.version>1.2.61</kotlin.version>
74+
<kotlin.version>1.3-M2</kotlin.version>
7575
</properties>
7676
```
7777

@@ -87,7 +87,7 @@ And make sure that you use the latest Kotlin version:
8787

8888
```groovy
8989
buildscript {
90-
ext.kotlin_version = '1.2.61'
90+
ext.kotlin_version = '1.3-M2'
9191
}
9292
```
9393

@@ -115,7 +115,7 @@ module as dependency when using `kotlinx.coroutines` on Android:
115115
```groovy
116116
implementation 'org.jetbrains.kotlinx:kotlinx-coroutines-android:0.26.0'
117117
```
118-
This gives you access to Android [Dispatchers.Main](https://kotlin.github.io/kotlinx.coroutines/kotlinx-coroutines-android/kotlinx.coroutines.experimental.android/kotlinx.coroutines.experimental.-dispatchers/index.html)
118+
This gives you access to Android [Dispatchers.Main](https://kotlin.github.io/kotlinx.coroutines/kotlinx-coroutines-android/kotlinx.coroutines.android/kotlinx.coroutines.-dispatchers/index.html)
119119
coroutine dispatcher and also makes sure that in case of crashed coroutine with unhandled exception this
120120
exception is logged before crashing Android application, similarly to the way uncaught exceptions in
121121
threads are handled by Android runtime.

benchmarks/src/jmh/kotlin/benchmarks/CancellableContinuationBenchmark.kt

+3-3
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,11 @@
44

55
package benchmarks
66

7-
import kotlinx.coroutines.experimental.*
7+
import kotlinx.coroutines.*
88
import org.openjdk.jmh.annotations.*
99
import java.util.concurrent.*
10-
import kotlin.coroutines.experimental.*
11-
import kotlin.coroutines.experimental.intrinsics.*
10+
import kotlin.coroutines.*
11+
import kotlin.coroutines.intrinsics.*
1212

1313
@Warmup(iterations = 5)
1414
@Measurement(iterations = 10)

benchmarks/src/jmh/kotlin/benchmarks/ChannelSinkBenchmark.kt

+3-3
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,11 @@
44

55
package benchmarks
66

7-
import kotlinx.coroutines.experimental.*
8-
import kotlinx.coroutines.experimental.channels.*
7+
import kotlinx.coroutines.*
8+
import kotlinx.coroutines.channels.*
99
import org.openjdk.jmh.annotations.*
1010
import java.util.concurrent.*
11-
import kotlin.coroutines.experimental.*
11+
import kotlin.coroutines.*
1212

1313
@Warmup(iterations = 10, time = 1)
1414
@Measurement(iterations = 10, time = 1)

benchmarks/src/jmh/kotlin/benchmarks/ForkJoinBenchmark.kt

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
package benchmarks
66

7-
import kotlinx.coroutines.experimental.*
7+
import kotlinx.coroutines.*
88
import org.openjdk.jmh.annotations.*
99
import java.util.concurrent.*
1010

benchmarks/src/jmh/kotlin/benchmarks/GuideSyncBenchmark.kt

+7-7
Original file line numberDiff line numberDiff line change
@@ -45,36 +45,36 @@ open class GuideSyncBenchmark {
4545

4646
@Benchmark
4747
fun sync01Problem() {
48-
kotlinx.coroutines.experimental.guide.sync01.main(emptyArray())
48+
kotlinx.coroutines.guide.sync01.main(emptyArray())
4949
}
5050

5151
@Benchmark
5252
fun sync02Volatile() {
53-
kotlinx.coroutines.experimental.guide.sync02.main(emptyArray())
53+
kotlinx.coroutines.guide.sync02.main(emptyArray())
5454
}
5555

5656
@Benchmark
5757
fun sync03AtomicInt() {
58-
kotlinx.coroutines.experimental.guide.sync03.main(emptyArray())
58+
kotlinx.coroutines.guide.sync03.main(emptyArray())
5959
}
6060

6161
@Benchmark
6262
fun sync04ConfineFine() {
63-
kotlinx.coroutines.experimental.guide.sync04.main(emptyArray())
63+
kotlinx.coroutines.guide.sync04.main(emptyArray())
6464
}
6565

6666
@Benchmark
6767
fun sync05ConfineCoarse() {
68-
kotlinx.coroutines.experimental.guide.sync05.main(emptyArray())
68+
kotlinx.coroutines.guide.sync05.main(emptyArray())
6969
}
7070

7171
@Benchmark
7272
fun sync06Mutex() {
73-
kotlinx.coroutines.experimental.guide.sync06.main(emptyArray())
73+
kotlinx.coroutines.guide.sync06.main(emptyArray())
7474
}
7575

7676
@Benchmark
7777
fun sync07Actor() {
78-
kotlinx.coroutines.experimental.guide.sync07.main(emptyArray())
78+
kotlinx.coroutines.guide.sync07.main(emptyArray())
7979
}
8080
}

benchmarks/src/jmh/kotlin/benchmarks/LaunchBenchmark.kt

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
package benchmarks
66

7-
import kotlinx.coroutines.experimental.*
7+
import kotlinx.coroutines.*
88
import org.openjdk.jmh.annotations.*
99
import java.util.concurrent.*
1010

benchmarks/src/jmh/kotlin/benchmarks/ParametrizedDispatcherBase.kt

+3-3
Original file line numberDiff line numberDiff line change
@@ -5,13 +5,13 @@
55
package benchmarks
66

77
import benchmarks.actors.CORES_COUNT
8-
import kotlinx.coroutines.experimental.*
9-
import kotlinx.coroutines.experimental.scheduling.*
8+
import kotlinx.coroutines.*
9+
import kotlinx.coroutines.scheduling.*
1010
import org.openjdk.jmh.annotations.Param
1111
import org.openjdk.jmh.annotations.Setup
1212
import org.openjdk.jmh.annotations.TearDown
1313
import java.io.Closeable
14-
import kotlin.coroutines.experimental.CoroutineContext
14+
import kotlin.coroutines.CoroutineContext
1515

1616
/**
1717
* Base class to use different [CoroutineContext] in benchmarks via [Param] in inheritors.

benchmarks/src/jmh/kotlin/benchmarks/StatefulAwaitsBenchmark.kt

+2-2
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@
44

55
package benchmarks
66

7-
import kotlinx.coroutines.experimental.*
8-
import kotlinx.coroutines.experimental.channels.*
7+
import kotlinx.coroutines.*
8+
import kotlinx.coroutines.channels.*
99
import org.openjdk.jmh.annotations.*
1010
import java.util.concurrent.*
1111

benchmarks/src/jmh/kotlin/benchmarks/actors/ConcurrentStatefulActorBenchmark.kt

+2-2
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,8 @@ package benchmarks.actors
66

77
import benchmarks.*
88
import benchmarks.actors.StatefulActorBenchmark.*
9-
import kotlinx.coroutines.experimental.*
10-
import kotlinx.coroutines.experimental.channels.*
9+
import kotlinx.coroutines.*
10+
import kotlinx.coroutines.channels.*
1111
import org.openjdk.jmh.annotations.*
1212
import java.util.concurrent.*
1313

benchmarks/src/jmh/kotlin/benchmarks/actors/CycledActorsBenchmark.kt

+2-2
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,8 @@ package benchmarks.actors
66

77
import benchmarks.*
88
import benchmarks.actors.PingPongActorBenchmark.*
9-
import kotlinx.coroutines.experimental.*
10-
import kotlinx.coroutines.experimental.channels.*
9+
import kotlinx.coroutines.*
10+
import kotlinx.coroutines.channels.*
1111
import org.openjdk.jmh.annotations.*
1212
import java.util.concurrent.*
1313

benchmarks/src/jmh/kotlin/benchmarks/actors/PingPongActorBenchmark.kt

+3-3
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,11 @@
55
package benchmarks.actors
66

77
import benchmarks.*
8-
import kotlinx.coroutines.experimental.*
9-
import kotlinx.coroutines.experimental.channels.*
8+
import kotlinx.coroutines.*
9+
import kotlinx.coroutines.channels.*
1010
import org.openjdk.jmh.annotations.*
1111
import java.util.concurrent.*
12-
import kotlin.coroutines.experimental.*
12+
import kotlin.coroutines.*
1313

1414
/*
1515
* Benchmark (dispatcher) Mode Cnt Score Error Units

benchmarks/src/jmh/kotlin/benchmarks/actors/PingPongWithBlockingContext.kt

+4-4
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,12 @@
44

55
package benchmarks.actors
66

7-
import kotlinx.coroutines.experimental.*
8-
import kotlinx.coroutines.experimental.channels.*
9-
import kotlinx.coroutines.experimental.scheduling.*
7+
import kotlinx.coroutines.*
8+
import kotlinx.coroutines.channels.*
9+
import kotlinx.coroutines.scheduling.*
1010
import org.openjdk.jmh.annotations.*
1111
import java.util.concurrent.*
12-
import kotlin.coroutines.experimental.*
12+
import kotlin.coroutines.*
1313

1414

1515
/*

benchmarks/src/jmh/kotlin/benchmarks/actors/StatefulActorBenchmark.kt

+2-2
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@
55
package benchmarks.actors
66

77
import benchmarks.*
8-
import kotlinx.coroutines.experimental.*
9-
import kotlinx.coroutines.experimental.channels.*
8+
import kotlinx.coroutines.*
9+
import kotlinx.coroutines.channels.*
1010
import org.openjdk.jmh.annotations.*
1111
import java.util.concurrent.*
1212

Original file line numberDiff line numberDiff line change
@@ -1,37 +1,37 @@
1-
public final class kotlinx/coroutines/experimental/android/AndroidExceptionPreHandler : kotlin/coroutines/experimental/AbstractCoroutineContextElement, kotlinx/coroutines/experimental/CoroutineExceptionHandler {
1+
public final class kotlinx/coroutines/android/AndroidExceptionPreHandler : kotlin/coroutines/AbstractCoroutineContextElement, kotlinx/coroutines/CoroutineExceptionHandler {
22
public fun <init> ()V
3-
public fun handleException (Lkotlin/coroutines/experimental/CoroutineContext;Ljava/lang/Throwable;)V
3+
public fun handleException (Lkotlin/coroutines/CoroutineContext;Ljava/lang/Throwable;)V
44
}
55

6-
public final class kotlinx/coroutines/experimental/android/HandlerContext : kotlinx/coroutines/experimental/android/HandlerDispatcher, kotlinx/coroutines/experimental/Delay {
6+
public final class kotlinx/coroutines/android/HandlerContext : kotlinx/coroutines/android/HandlerDispatcher, kotlinx/coroutines/Delay {
77
public fun <init> (Landroid/os/Handler;Ljava/lang/String;)V
88
public synthetic fun <init> (Landroid/os/Handler;Ljava/lang/String;ILkotlin/jvm/internal/DefaultConstructorMarker;)V
9-
public final fun awaitFrame (Lkotlin/coroutines/experimental/Continuation;)Ljava/lang/Object;
10-
public fun dispatch (Lkotlin/coroutines/experimental/CoroutineContext;Ljava/lang/Runnable;)V
9+
public final fun awaitFrame (Lkotlin/coroutines/Continuation;)Ljava/lang/Object;
10+
public fun dispatch (Lkotlin/coroutines/CoroutineContext;Ljava/lang/Runnable;)V
1111
public fun equals (Ljava/lang/Object;)Z
12-
public fun getImmediate ()Lkotlinx/coroutines/experimental/android/HandlerContext;
13-
public synthetic fun getImmediate ()Lkotlinx/coroutines/experimental/android/HandlerDispatcher;
12+
public fun getImmediate ()Lkotlinx/coroutines/android/HandlerContext;
13+
public synthetic fun getImmediate ()Lkotlinx/coroutines/android/HandlerDispatcher;
1414
public fun hashCode ()I
15-
public fun invokeOnTimeout (JLjava/util/concurrent/TimeUnit;Ljava/lang/Runnable;)Lkotlinx/coroutines/experimental/DisposableHandle;
16-
public fun isDispatchNeeded (Lkotlin/coroutines/experimental/CoroutineContext;)Z
17-
public fun scheduleResumeAfterDelay (JLjava/util/concurrent/TimeUnit;Lkotlinx/coroutines/experimental/CancellableContinuation;)V
15+
public fun invokeOnTimeout (JLjava/util/concurrent/TimeUnit;Ljava/lang/Runnable;)Lkotlinx/coroutines/DisposableHandle;
16+
public fun isDispatchNeeded (Lkotlin/coroutines/CoroutineContext;)Z
17+
public fun scheduleResumeAfterDelay (JLjava/util/concurrent/TimeUnit;Lkotlinx/coroutines/CancellableContinuation;)V
1818
public fun toString ()Ljava/lang/String;
1919
}
2020

21-
public final class kotlinx/coroutines/experimental/android/HandlerContextKt {
22-
public static final synthetic fun asCoroutineDispatcher (Landroid/os/Handler;)Lkotlinx/coroutines/experimental/android/HandlerContext;
23-
public static final fun getUI ()Lkotlinx/coroutines/experimental/android/HandlerContext;
21+
public final class kotlinx/coroutines/android/HandlerContextKt {
22+
public static final synthetic fun asCoroutineDispatcher (Landroid/os/Handler;)Lkotlinx/coroutines/android/HandlerContext;
23+
public static final fun getUI ()Lkotlinx/coroutines/android/HandlerContext;
2424
}
2525

26-
public abstract class kotlinx/coroutines/experimental/android/HandlerDispatcher : kotlinx/coroutines/experimental/CoroutineDispatcher, kotlinx/coroutines/experimental/Delay {
27-
public fun delay (JLjava/util/concurrent/TimeUnit;Lkotlin/coroutines/experimental/Continuation;)Ljava/lang/Object;
28-
public abstract fun getImmediate ()Lkotlinx/coroutines/experimental/android/HandlerDispatcher;
29-
public fun invokeOnTimeout (JLjava/util/concurrent/TimeUnit;Ljava/lang/Runnable;)Lkotlinx/coroutines/experimental/DisposableHandle;
26+
public abstract class kotlinx/coroutines/android/HandlerDispatcher : kotlinx/coroutines/CoroutineDispatcher, kotlinx/coroutines/Delay {
27+
public fun delay (JLjava/util/concurrent/TimeUnit;Lkotlin/coroutines/Continuation;)Ljava/lang/Object;
28+
public abstract fun getImmediate ()Lkotlinx/coroutines/android/HandlerDispatcher;
29+
public fun invokeOnTimeout (JLjava/util/concurrent/TimeUnit;Ljava/lang/Runnable;)Lkotlinx/coroutines/DisposableHandle;
3030
}
3131

32-
public final class kotlinx/coroutines/experimental/android/HandlerDispatcherKt {
33-
public static final fun asCoroutineDispatcher (Landroid/os/Handler;)Lkotlinx/coroutines/experimental/android/HandlerDispatcher;
34-
public static final fun awaitFrame (Lkotlin/coroutines/experimental/Continuation;)Ljava/lang/Object;
35-
public static final fun getMain (Lkotlinx/coroutines/experimental/Dispatchers;)Lkotlinx/coroutines/experimental/android/HandlerDispatcher;
32+
public final class kotlinx/coroutines/android/HandlerDispatcherKt {
33+
public static final fun asCoroutineDispatcher (Landroid/os/Handler;)Lkotlinx/coroutines/android/HandlerDispatcher;
34+
public static final fun awaitFrame (Lkotlin/coroutines/Continuation;)Ljava/lang/Object;
35+
public static final fun getMain (Lkotlinx/coroutines/Dispatchers;)Lkotlinx/coroutines/android/HandlerDispatcher;
3636
}
3737

0 commit comments

Comments
 (0)