summaryrefslogtreecommitdiff
path: root/opendc-utils/src
diff options
context:
space:
mode:
authorFabian Mastenbroek <mail.fabianm@gmail.com>2021-05-18 15:51:13 +0200
committerGitHub <noreply@github.com>2021-05-18 15:51:13 +0200
commit02776c958a3254735b2be7d9fb1627f75e7f80cd (patch)
tree155d96b0f1a5173e4ac884ac6c9cbccea011918f /opendc-utils/src
parent1ce710ebaa8b071a3b30447d431f4af422f25156 (diff)
parent7cbb401a0939cc58daae8b481a97f4b05140ec3b (diff)
build: Add support for Java 16
This pull request adds support for building OpenDC using Java 16. To make this possible, we have upgraded the following dependencies: - Kotlin from 1.4.3 to 1.5.0 - Jacoco from 0.8.6 to 0.8.7 - Gradle from 7.0 to 7.0.2
Diffstat (limited to 'opendc-utils/src')
-rw-r--r--opendc-utils/src/main/kotlin/org/opendc/utils/TimerScheduler.kt7
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