Skip to content

Commit 01dcfe5

Browse files
authored
Rename TimeSource to SchedulerTimeSource due to KT-42625 (#2537)
1 parent 88b0966 commit 01dcfe5

File tree

2 files changed

+6
-5
lines changed

2 files changed

+6
-5
lines changed

kotlinx-coroutines-core/jvm/src/scheduling/Tasks.kt

+4-3
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ internal val IDLE_WORKER_KEEP_ALIVE_NS = TimeUnit.SECONDS.toNanos(
5252
)
5353

5454
@JvmField
55-
internal var schedulerTimeSource: TimeSource = NanoTimeSource
55+
internal var schedulerTimeSource: SchedulerTimeSource = NanoTimeSource
5656

5757
/**
5858
* Marker indicating that task is CPU-bound and will not block
@@ -108,10 +108,11 @@ internal class TaskImpl(
108108
// Open for tests
109109
internal class GlobalQueue : LockFreeTaskQueue<Task>(singleConsumer = false)
110110

111-
internal abstract class TimeSource {
111+
// Was previously TimeSource, renamed due to KT-42625 and KT-23727
112+
internal abstract class SchedulerTimeSource {
112113
abstract fun nanoTime(): Long
113114
}
114115

115-
internal object NanoTimeSource : TimeSource() {
116+
internal object NanoTimeSource : SchedulerTimeSource() {
116117
override fun nanoTime() = System.nanoTime()
117118
}

kotlinx-coroutines-core/jvm/test/scheduling/TestTimeSource.kt

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
/*
2-
* Copyright 2016-2018 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license.
2+
* Copyright 2016-2021 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license.
33
*/
44

55
package kotlinx.coroutines.scheduling
66

77

8-
internal class TestTimeSource(var time: Long) : TimeSource() {
8+
internal class TestTimeSource(var time: Long) : SchedulerTimeSource() {
99

1010
override fun nanoTime() = time
1111

0 commit comments

Comments
 (0)