Skip to content

Commit d5c0eff

Browse files
authored
Fix warnings in Native (#3957)
1 parent addb524 commit d5c0eff

File tree

6 files changed

+11
-4
lines changed

6 files changed

+11
-4
lines changed

buildSrc/src/main/kotlin/configure-compilation-conventions.gradle.kts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ configure(subprojects) {
1010
if (name in sourceless) return@configure
1111
apply(plugin = "kotlinx-atomicfu")
1212
tasks.withType<KotlinCompile<*>>().configureEach {
13-
val isMainTaskName = name == "compileKotlin" || name == "compileKotlinJvm"
13+
val isMainTaskName = name.startsWith("compileKotlin")
1414
kotlinOptions {
1515
languageVersion = getOverriddenKotlinLanguageVersion(project)
1616
apiVersion = getOverriddenKotlinApiVersion(project)

kotlinx-coroutines-core/common/src/EventLoop.common.kt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ package kotlinx.coroutines
66

77
import kotlinx.atomicfu.*
88
import kotlinx.coroutines.internal.*
9+
import kotlin.concurrent.Volatile
910
import kotlin.coroutines.*
1011
import kotlin.jvm.*
1112

kotlinx-coroutines-core/native/src/Builders.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
* Copyright 2016-2021 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license.
33
*/
44

5-
@file:OptIn(ExperimentalContracts::class)
5+
@file:OptIn(ExperimentalContracts::class, ObsoleteWorkersApi::class)
66
package kotlinx.coroutines
77

88
import kotlinx.cinterop.*

kotlinx-coroutines-core/native/src/EventLoop.kt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22
* Copyright 2016-2021 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license.
33
*/
44

5+
@file:OptIn(ObsoleteWorkersApi::class)
6+
57
package kotlinx.coroutines
68

79
import kotlin.coroutines.*
@@ -28,4 +30,5 @@ internal class EventLoopImpl: EventLoopImplBase() {
2830

2931
internal actual fun createEventLoop(): EventLoop = EventLoopImpl()
3032

33+
@Suppress("DEPRECATION")
3134
internal actual fun nanoTime(): Long = getTimeNanos()

kotlinx-coroutines-core/native/src/MultithreadedDispatchers.kt

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,16 @@
22
* Copyright 2016-2021 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license.
33
*/
44

5+
@file:OptIn(ObsoleteWorkersApi::class)
6+
57
package kotlinx.coroutines
68

79
import kotlinx.atomicfu.*
810
import kotlinx.coroutines.channels.*
911
import kotlinx.coroutines.internal.*
1012
import kotlin.coroutines.*
1113
import kotlin.concurrent.AtomicReference
12-
import kotlin.native.concurrent.Worker
14+
import kotlin.native.concurrent.*
1315
import kotlin.time.*
1416
import kotlin.time.Duration.Companion.milliseconds
1517

@@ -18,7 +20,6 @@ public actual fun newFixedThreadPoolContext(nThreads: Int, name: String): Closea
1820
return MultiWorkerDispatcher(name, nThreads)
1921
}
2022

21-
@OptIn(ExperimentalTime::class)
2223
internal class WorkerDispatcher(name: String) : CloseableCoroutineDispatcher(), Delay {
2324
private val worker = Worker.start(name = name)
2425

kotlinx-coroutines-core/native/src/internal/ThreadLocal.kt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@
44

55
package kotlinx.coroutines.internal
66

7+
import kotlin.native.concurrent.ThreadLocal
8+
79
internal actual class CommonThreadLocal<T>(private val name: Symbol) {
810
@Suppress("UNCHECKED_CAST")
911
actual fun get(): T = Storage[name] as T

0 commit comments

Comments
 (0)