Skip to content

Commit 3ac73f6

Browse files
committed
Merge branch 'develop' into coroutines-scheduler-forcepush
# Conflicts: # benchmarks/src/jmh/kotlin/benchmarks/PingPongActorBenchmark.kt # core/kotlinx-coroutines-core/src/CommonPool.kt # core/kotlinx-coroutines-core/src/test/kotlin/kotlinx/coroutines/experimental/WithContextCommonPoolTest.kt # core/kotlinx-coroutines-core/src/test/kotlin/kotlinx/coroutines/experimental/WithDefaultContextTest.kt # core/kotlinx-coroutines-core/test/TestBase.kt # core/kotlinx-coroutines-core/test/WithContextCommonPoolTest.kt # integration/kotlinx-coroutines-jdk8/src/test/kotlin/examples/ToFuture-example.kt
2 parents e50fb89 + 7f2ed2f commit 3ac73f6

File tree

677 files changed

+6669
-7608
lines changed

Some content is hidden

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

677 files changed

+6669
-7608
lines changed

CHANGES.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,15 @@
11
# Change log for kotlinx.coroutines
22

3+
## Version 0.23.4
4+
5+
* Recompiled with Kotlin 1.2.51 to solve broken metadata problem (see [KT-24944](https://youtrack.jetbrains.com/issue/KT-24944)).
6+
7+
## Version 0.23.3
8+
9+
* Kotlin 1.2.50.
10+
* JS: Moved to atomicfu version 0.10.3 that properly matches NPM & Kotlin/JS module names (see #396).
11+
* Improve source-code compatibility with previous (0.22.x) version of `openChannel().use { ... }` pattern by providing deprecated extension function `use` on `ReceiveChannel`.
12+
313
## Version 0.23.2
414

515
* IO: fix joining and continuous writing byte array interference.

LICENSE.txt

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
Copyright 2016-2018 JetBrains s.r.o.
2+
3+
Licensed under the Apache License, Version 2.0 (the "License");
4+
you may not use this file except in compliance with the License.
5+
You may obtain a copy of the License at
6+
7+
http://www.apache.org/licenses/LICENSE-2.0
8+
9+
Unless required by applicable law or agreed to in writing, software
10+
distributed under the License is distributed on an "AS IS" BASIS,
11+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
See the License for the specific language governing permissions and
13+
limitations under the License.

README.md

Lines changed: 29 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,10 @@
22

33
[![official JetBrains project](http://jb.gg/badges/official.svg)](https://confluence.jetbrains.com/display/ALL/JetBrains+on+GitHub)
44
[![GitHub license](https://img.shields.io/badge/license-Apache%20License%202.0-blue.svg?style=flat)](http://www.apache.org/licenses/LICENSE-2.0)
5-
[![Download](https://api.bintray.com/packages/kotlin/kotlinx/kotlinx.coroutines/images/download.svg?version=0.23.2) ](https://bintray.com/kotlin/kotlinx/kotlinx.coroutines/0.23.2)
5+
[![Download](https://api.bintray.com/packages/kotlin/kotlinx/kotlinx.coroutines/images/download.svg?version=0.23.4) ](https://bintray.com/kotlin/kotlinx/kotlinx.coroutines/0.23.4)
66

7-
Library support for Kotlin coroutines in
8-
[Kotlin/JVM](core/README.md) and
9-
[Kotlin/JS](js/README.md).
10-
This is a companion version for Kotlin 1.2.21 release.
7+
Library support for Kotlin coroutines with [multiplatform](#multiplatform) support.
8+
This is a companion version for Kotlin 1.2.51 release.
119

1210
```kotlin
1311
launch {
@@ -22,12 +20,13 @@ launch {
2220
* `launch` and `async` coroutine builders;
2321
* `Job` and `Deferred` light-weight future with cancellation support;
2422
* `delay` and `yield` top-level suspending functions.
25-
* [js](js/README.md) — Kotlin/JS implementation of common coroutines with `Promise` support.
2623
* [core](core/README.md) — Kotlin/JVM implementation of common coroutines with additional features:
2724
* `CommonPool` coroutine context (default on JVM);
2825
* `Channel` and `Mutex` communication and synchronization primitives;
2926
* `produce` and `actor` coroutine builders;
3027
* `select` expression support and more.
28+
* [js](js/README.md) — Kotlin/JS implementation of common coroutines with `Promise` support.
29+
* [native](native/README.md) — Kotlin/Native implementation of common coroutines with `runBlocking` single-threaded event loop.
3130
* [reactive](reactive/README.md) — modules that provide builders and iteration support for various reactive streams libraries:
3231
* Reactive Streams, RxJava 1.x and 2.x and Project Reactor.
3332
* [ui](ui/README.md) — modules that provide coroutine dispatchers for various single-threaded UI libraries:
@@ -64,15 +63,15 @@ Add dependencies (you can also add other modules that you need):
6463
<dependency>
6564
<groupId>org.jetbrains.kotlinx</groupId>
6665
<artifactId>kotlinx-coroutines-core</artifactId>
67-
<version>0.23.2</version>
66+
<version>0.23.4</version>
6867
</dependency>
6968
```
7069

7170
And make sure that you use the latest Kotlin version:
7271

7372
```xml
7473
<properties>
75-
<kotlin.version>1.2.21</kotlin.version>
74+
<kotlin.version>1.2.51</kotlin.version>
7675
</properties>
7776
```
7877

@@ -81,14 +80,14 @@ And make sure that you use the latest Kotlin version:
8180
Add dependencies (you can also add other modules that you need):
8281

8382
```groovy
84-
compile 'org.jetbrains.kotlinx:kotlinx-coroutines-core:0.23.2'
83+
compile 'org.jetbrains.kotlinx:kotlinx-coroutines-core:0.23.4'
8584
```
8685

8786
And make sure that you use the latest Kotlin version:
8887

8988
```groovy
9089
buildscript {
91-
ext.kotlin_version = '1.2.21'
90+
ext.kotlin_version = '1.2.51'
9291
}
9392
```
9493

@@ -100,10 +99,27 @@ repository {
10099
}
101100
```
102101

103-
### Kotlin/JS
102+
### Multiplatform
103+
104+
Core modules of `kotlinx.coroutines` are also available for
105+
[Kotlin/JS](js/README.md) and [Kotlin/Native](native/README.md). If you write
106+
a common code that should get compiled or different platforms, add
107+
[`org.jetbrains.kotlinx:kotlinx-coroutines-core-common:<version>`](common/kotlinx-coroutines-core-common/README.md)
108+
to your common code dependencies.
109+
110+
### Android
111+
112+
Add [`kotlinx-coroutines-android`](ui/kotlinx-coroutines-android)
113+
module as dependency when using `kotlinx.coroutines` on Android:
114+
115+
```groovy
116+
compile 'org.jetbrains.kotlinx:kotlinx-coroutines-android:0.23.4'
117+
```
104118

105-
Use `org.jetbrains.kotlinx:kotlinx-coroutines-core-js:<version>` artifact in your Gradle/Maven dependencies
106-
or install [`kotlinx-coroutines-core`](https://www.npmjs.com/package/kotlinx-coroutines-core) package via NPM.
119+
This gives you access to Android [UI](https://kotlin.github.io/kotlinx.coroutines/kotlinx-coroutines-android/kotlinx.coroutines.experimental.android/-u-i.html)
120+
coroutine dispatcher and also makes sure that in case of crashed coroutine with unhandled exception this
121+
exception is logged before crashing Android application, similarly to the way uncaught exceptions in
122+
threads are handled by Android runtime.
107123

108124
### ProGuard
109125

benchmarks/build.gradle

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
/*
2+
* Copyright 2016-2018 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license.
3+
*/
4+
15
plugins {
26
id "me.champeau.gradle.jmh" version "0.4.4"
37
}

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

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
/*
2+
* Copyright 2016-2018 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license.
3+
*/
4+
15
package benchmarks
26

37
import kotlinx.coroutines.experimental.*

benchmarks/src/jmh/kotlin/benchmarks/ChannelCopyBenchmark.kt

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
/*
2+
* Copyright 2016-2018 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license.
3+
*/
4+
15
package benchmarks
26

37
import kotlinx.coroutines.experimental.*

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

Lines changed: 1 addition & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -1,32 +1,5 @@
11
/*
2-
* Copyright (c) 2014, Oracle America, Inc.
3-
* All rights reserved.
4-
*
5-
* Redistribution and use in source and binary forms, with or without
6-
* modification, are permitted provided that the following conditions are met:
7-
*
8-
* * Redistributions of source code must retain the above copyright notice,
9-
* this list of conditions and the following disclaimer.
10-
*
11-
* * Redistributions in binary form must reproduce the above copyright
12-
* notice, this list of conditions and the following disclaimer in the
13-
* documentation and/or other materials provided with the distribution.
14-
*
15-
* * Neither the name of Oracle nor the names of its contributors may be used
16-
* to endorse or promote products derived from this software without
17-
* specific prior written permission.
18-
*
19-
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
20-
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
21-
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
22-
* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
23-
* LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
24-
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
25-
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
26-
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
27-
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
28-
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
29-
* THE POSSIBILITY OF SUCH DAMAGE.
2+
* Copyright 2016-2018 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license.
303
*/
314

325
package benchmarks

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import benchmarks.actors.CORES_COUNT
44
import kotlinx.coroutines.experimental.CommonPool
55
import kotlinx.coroutines.experimental.ThreadPoolDispatcher
66
import kotlinx.coroutines.experimental.newFixedThreadPoolContext
7-
import kotlinx.coroutines.experimental.scheduling.ExperimentalCoroutineDispatcher
7+
import scheduling.ExperimentalCoroutineDispatcher
88
import org.openjdk.jmh.annotations.Param
99
import org.openjdk.jmh.annotations.Setup
1010
import org.openjdk.jmh.annotations.TearDown

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@ package benchmarks.actors
22

33
import kotlinx.coroutines.experimental.*
44
import kotlinx.coroutines.experimental.channels.*
5-
import kotlinx.coroutines.experimental.scheduling.*
65
import org.openjdk.jmh.annotations.*
6+
import scheduling.*
77
import java.util.concurrent.*
88
import kotlin.coroutines.experimental.*
99

binary-compatibility-validator/build.gradle

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
/*
2+
* Copyright 2016-2018 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license.
3+
*/
4+
15
configurations {
26
testArtifacts
37
}
@@ -37,7 +41,7 @@ compileTestKotlin {
3741
sourceSets {
3842
test {
3943
java {
40-
srcDir "src/test/kotlin"
44+
srcDir "test/cases"
4145
}
4246
}
4347
}

0 commit comments

Comments
 (0)