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
Copy file name to clipboardExpand all lines: CHANGES.md
+19
Original file line number
Diff line number
Diff line change
@@ -1,5 +1,24 @@
1
1
# Change log for kotlinx.coroutines
2
2
3
+
## Version 1.10.1
4
+
5
+
* Fixed binary incompatibility introduced for non-JVM targets in #4261 (#4309).
6
+
7
+
## Version 1.10.0
8
+
9
+
* Kotlin was updated to 2.1.0 (#4284).
10
+
* Introduced `Flow.any`, `Flow.all`, and `Flow.none` (#4212). Thanks, @CLOVIS-AI!
11
+
* Reorganized `kotlinx-coroutines-debug` and `kotlinx-coroutines-core` code to avoid a split package between the two artifacts (#4247). Note that directly referencing `kotlinx.coroutines.debug.AgentPremain` must now be replaced with `kotlinx.coroutines.debug.internal.AgentPremain`. Thanks, @sellmair!
12
+
* No longer shade byte-buddy in `kotlinx-coroutines-debug`, reducing the artifact size and simplifying the build configuration of client code. Thanks, @sellmair!
13
+
* Fixed `NullPointerException` when using Java-deserialized `kotlinx-coroutines-core` exceptions (#4291). Thanks, @AlexRiedler!
14
+
* Properly report exceptions thrown by `CoroutineDispatcher.dispatch` instead of raising internal errors (#4091). Thanks, @zuevmaxim!
15
+
* Fixed a bug that delayed scheduling of a `Dispatchers.Default` or `Dispatchers.IO` task after a `yield()` in rare scenarios (#4248).
16
+
* Fixed a bug that prevented the `main()` coroutine on Wasm/WASI from executing after a `delay()` call in some scenarios (#4239).
17
+
* Fixed scheduling of `runBlocking` tasks on Kotlin/Native that arrive after the `runBlocking` block was exited (#4245).
18
+
* Fixed some terminal `Flow` operators sometimes resuming without taking cancellation into account (#4254). Thanks, @jxdabc!
19
+
* Fixed a bug on the JVM that caused coroutine-bound `ThreadLocal` values not to get cleaned when using non-`CoroutineDispatcher` continuation interceptors (#4296).
20
+
* Small tweaks, fixes, and documentation improvements.
> You can get the full code [here](../../kotlinx-coroutines-core/jvm/test/guide/example-cancel-01.kt).
35
+
<!--- KNIT example-cancel-01.kt -->
36
+
> You can get the full code [here](https://github.com/Kotlin/kotlinx.coroutines/blob/master/kotlinx-coroutines-core/jvm/test/guide/example-cancel-01.kt).
> You can get the full code [here](../../kotlinx-coroutines-core/jvm/test/guide/example-cancel-02.kt).
89
+
<!--- KNIT example-cancel-02.kt -->
90
+
> You can get the full code [here](https://github.com/Kotlin/kotlinx.coroutines/blob/master/kotlinx-coroutines-core/jvm/test/guide/example-cancel-02.kt).
90
91
>
91
-
{type="note"}
92
+
{style="note"}
92
93
93
94
Run it to see that it continues to print "I'm sleeping" even after cancellation
94
95
until the job completes by itself after five iterations.
> You can get the full code [here](../../kotlinx-coroutines-core/jvm/test/guide/example-cancel-03.kt).
134
+
<!--- KNIT example-cancel-03.kt -->
135
+
> You can get the full code [here](https://github.com/Kotlin/kotlinx.coroutines/blob/master/kotlinx-coroutines-core/jvm/test/guide/example-cancel-03.kt).
135
136
>
136
-
{type="note"}
137
+
{style="note"}
137
138
138
139
While catching `Exception` is an anti-pattern, this issue may surface in more subtle ways, like when using the
> You can get the full code [here](../../kotlinx-coroutines-core/jvm/test/guide/example-cancel-04.kt).
176
+
<!--- KNIT example-cancel-04.kt -->
177
+
> You can get the full code [here](https://github.com/Kotlin/kotlinx.coroutines/blob/master/kotlinx-coroutines-core/jvm/test/guide/example-cancel-04.kt).
177
178
>
178
-
{type="note"}
179
+
{style="note"}
179
180
180
181
As you can see, now this loop is cancelled. [isActive] is an extension property
181
182
available inside the coroutine via the [CoroutineScope] object.
@@ -188,7 +189,7 @@ main: I'm tired of waiting!
188
189
main: Now I can quit.
189
190
-->
190
191
191
-
## Closing resources with `finally`
192
+
## Closing resources with finally
192
193
193
194
Cancellable suspending functions throw [CancellationException] on cancellation, which can be handled in
194
195
the usual way. For example, the `try {...} finally {...}` expression and Kotlin's `use` function execute their
> You can get the full code [here](../../kotlinx-coroutines-core/jvm/test/guide/example-cancel-05.kt).
221
+
<!--- KNIT example-cancel-05.kt -->
222
+
> You can get the full code [here](https://github.com/Kotlin/kotlinx.coroutines/blob/master/kotlinx-coroutines-core/jvm/test/guide/example-cancel-05.kt).
222
223
>
223
-
{type="note"}
224
+
{style="note"}
224
225
225
226
Both [join][Job.join] and [cancelAndJoin] wait for all finalization actions to complete,
226
227
so the example above produces the following output:
> You can get the full code [here](../../kotlinx-coroutines-core/jvm/test/guide/example-cancel-06.kt).
276
+
<!--- KNIT example-cancel-06.kt -->
277
+
> You can get the full code [here](https://github.com/Kotlin/kotlinx.coroutines/blob/master/kotlinx-coroutines-core/jvm/test/guide/example-cancel-06.kt).
> You can get the full code [here](../../kotlinx-coroutines-core/jvm/test/guide/example-cancel-07.kt).
314
+
<!--- KNIT example-cancel-07.kt -->
315
+
> You can get the full code [here](https://github.com/Kotlin/kotlinx.coroutines/blob/master/kotlinx-coroutines-core/jvm/test/guide/example-cancel-07.kt).
> You can get the full code [here](../../kotlinx-coroutines-core/jvm/test/guide/example-cancel-08.kt).
357
+
<!--- KNIT example-cancel-08.kt -->
358
+
> You can get the full code [here](https://github.com/Kotlin/kotlinx.coroutines/blob/master/kotlinx-coroutines-core/jvm/test/guide/example-cancel-08.kt).
358
359
>
359
-
{type="note"}
360
+
{style="note"}
360
361
361
362
There is no longer an exception when running this code:
> You can get the full code [here](../../kotlinx-coroutines-core/jvm/test/guide/example-cancel-09.kt).
418
+
<!--- KNIT example-cancel-09.kt -->
419
+
> You can get the full code [here](https://github.com/Kotlin/kotlinx.coroutines/blob/master/kotlinx-coroutines-core/jvm/test/guide/example-cancel-09.kt).
419
420
>
420
-
{type="note"}
421
+
{style="note"}
421
422
422
423
<!--- CLEAR -->
423
424
@@ -428,7 +429,7 @@ of your machine. You may need to tweak the timeout in this example to actually s
428
429
> since it always happens from the same thread, the one used by `runBlocking`.
429
430
> More on that will be explained in the chapter on coroutine context.
430
431
>
431
-
{type="note"}
432
+
{style="note"}
432
433
433
434
To work around this problem you can store a reference to the resource in a variable instead of returning it
> You can get the full code [here](../../kotlinx-coroutines-core/jvm/test/guide/example-cancel-10.kt).
471
+
<!--- KNIT example-cancel-10.kt -->
472
+
> You can get the full code [here](https://github.com/Kotlin/kotlinx.coroutines/blob/master/kotlinx-coroutines-core/jvm/test/guide/example-cancel-10.kt).
472
473
>
473
-
{type="note"}
474
+
{style="note"}
474
475
475
476
This example always prints zero. Resources do not leak.
0 commit comments