-
Igor Demin authored
After https://github.com/JetBrains/skiko/pull/798, we changed Dispatcher.IO to custom dispatcher. Dispatcher.IO is based on daemon threads (thread that receives InterruptException on application exit). Our new dispatcher isn't. The proof: ``` import java.util.concurrent.Executors import kotlinx.coroutines.Dispatchers import kotlinx.coroutines.asCoroutineDispatcher import kotlinx.coroutines.runBlocking fun main() { runBlocking(Dispatchers.IO) { println(Thread.currentThread().isDaemon) // prints true } runBlocking(Executors.newCachedThreadPool().asCoroutineDispatcher()) { println(Thread.currentThread().isDaemon) // prints false } val defaultFactory = Executors.defaultThreadFactory() runBlocking(Executors.newCachedThreadPool { defaultFactory.newThread(it).apply { isDaemon = true } }.asCoroutineDispatcher()) { println(Thread.currentThread().isDaemon) // prints true } } ``` This PR makes threads daemon. Reported in [Kotlin Slack](https://kotlinlang.slack.com/archives/C01D6HTPATV/p1697400320739369) - applications exits too long.
| Name |
Last commit
|
Last update |
|---|---|---|
| .. | ||
| .run | ||
| buildSrc | ||
| ci | ||
| docker | ||
| gradle/wrapper | ||
| karma.config.d | ||
| src | ||
| tools | ||
| .gitignore | ||
| RELEASE.md | ||
| build.gradle.kts | ||
| gradle.properties | ||
| gradlew | ||
| gradlew.bat | ||
| settings.gradle.kts |