diff options
| author | Fabian Mastenbroek <mail.fabianm@gmail.com> | 2021-05-05 23:14:56 +0200 |
|---|---|---|
| committer | Fabian Mastenbroek <mail.fabianm@gmail.com> | 2021-05-18 15:21:29 +0200 |
| commit | cc9310efad6177909ff2f7415384d7c393383106 (patch) | |
| tree | 5e94f0443cdf1c63ec77248aaf520974e5bfd7d0 /opendc-utils/src/main/kotlin/org | |
| parent | ef3868ec729f7ce3f5976d4f9a0c8b95098d9857 (diff) | |
chore: Address deprecations due to Kotlin 1.5
This change addresses the deprecations that were caused by the migration
to Kotlin 1.5.
Diffstat (limited to 'opendc-utils/src/main/kotlin/org')
| -rw-r--r-- | opendc-utils/src/main/kotlin/org/opendc/utils/TimerScheduler.kt | 7 |
1 files changed, 3 insertions, 4 deletions
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<T>(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<T>(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 |
