From cc9310efad6177909ff2f7415384d7c393383106 Mon Sep 17 00:00:00 2001 From: Fabian Mastenbroek Date: Wed, 5 May 2021 23:14:56 +0200 Subject: chore: Address deprecations due to Kotlin 1.5 This change addresses the deprecations that were caused by the migration to Kotlin 1.5. --- opendc-utils/src/main/kotlin/org/opendc/utils/TimerScheduler.kt | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) (limited to 'opendc-utils/src') diff --git a/opendc-utils/src/main/kotlin/org/opendc/utils/TimerScheduler.kt b/opendc-utils/src/main/kotlin/org/opendc/utils/TimerScheduler.kt index aa2f3367..d7da7f99 100644 --- a/opendc-utils/src/main/kotlin/org/opendc/utils/TimerScheduler.kt +++ b/opendc-utils/src/main/kotlin/org/opendc/utils/TimerScheduler.kt @@ -24,7 +24,6 @@ package org.opendc.utils import kotlinx.coroutines.* import kotlinx.coroutines.channels.Channel -import kotlinx.coroutines.channels.sendBlocking import kotlinx.coroutines.selects.select import java.time.Clock import java.util.* @@ -145,9 +144,9 @@ public class TimerScheduler(context: CoroutineContext, private val clock: Clo queue.poll() if (queue.isNotEmpty()) { - channel.sendBlocking(peek.timestamp) + channel.trySend(peek.timestamp) } else { - channel.sendBlocking(null) + channel.trySend(null) } } } @@ -212,7 +211,7 @@ public class TimerScheduler(context: CoroutineContext, private val clock: Clo // Check if we need to push the interruption forward // Note that we check by timer reference if (queue.peek() === timer) { - channel.offer(timer.timestamp) + channel.trySend(timer.timestamp) } timer -- cgit v1.2.3