@@ -10,21 +10,21 @@ package kotlinx.coroutines
1010import java.util.concurrent.locks.*
1111import kotlin.internal.InlineOnly
1212
13- internal interface TimeSource {
14- fun currentTimeMillis (): Long
15- fun nanoTime (): Long
16- fun wrapTask (block : Runnable ): Runnable
17- fun trackTask ()
18- fun unTrackTask ()
19- fun registerTimeLoopThread ()
20- fun unregisterTimeLoopThread ()
21- fun parkNanos (blocker : Any , nanos : Long ) // should return immediately when nanos <= 0
22- fun unpark (thread : Thread )
13+ internal abstract class AbstractTimeSource {
14+ abstract fun currentTimeMillis (): Long
15+ abstract fun nanoTime (): Long
16+ abstract fun wrapTask (block : Runnable ): Runnable
17+ abstract fun trackTask ()
18+ abstract fun unTrackTask ()
19+ abstract fun registerTimeLoopThread ()
20+ abstract fun unregisterTimeLoopThread ()
21+ abstract fun parkNanos (blocker : Any , nanos : Long ) // should return immediately when nanos <= 0
22+ abstract fun unpark (thread : Thread )
2323}
2424
2525// For tests only
2626// @JvmField: Don't use JvmField here to enable R8 optimizations via "assumenosideeffects"
27- internal var timeSource: TimeSource ? = null
27+ internal var timeSource: AbstractTimeSource ? = null
2828
2929@InlineOnly
3030internal inline fun currentTimeMillis (): Long =
0 commit comments