summaryrefslogtreecommitdiff
path: root/opendc
diff options
context:
space:
mode:
Diffstat (limited to 'opendc')
-rw-r--r--opendc/opendc-compute/src/main/kotlin/com/atlarge/opendc/compute/metal/driver/SimpleBareMetalDriver.kt9
1 files changed, 5 insertions, 4 deletions
diff --git a/opendc/opendc-compute/src/main/kotlin/com/atlarge/opendc/compute/metal/driver/SimpleBareMetalDriver.kt b/opendc/opendc-compute/src/main/kotlin/com/atlarge/opendc/compute/metal/driver/SimpleBareMetalDriver.kt
index a0ca2347..6a77415c 100644
--- a/opendc/opendc-compute/src/main/kotlin/com/atlarge/opendc/compute/metal/driver/SimpleBareMetalDriver.kt
+++ b/opendc/opendc-compute/src/main/kotlin/com/atlarge/opendc/compute/metal/driver/SimpleBareMetalDriver.kt
@@ -267,10 +267,13 @@ public class SimpleBareMetalDriver(
/**
* Cache the [Clock] for timing.
*/
- private val clock= domain.coroutineContext[SimulationContext]!!.clock
+ private val clock = domain.coroutineContext[SimulationContext]!!.clock
/**
- * Cache the [Delay] instance for timing. Ugly hack which may break in the future.
+ * Cache the [Delay] instance for timing.
+ *
+ * XXX We need to cache this before the call to [onRun] since doing this in [onRun] is too heavy.
+ * XXX Note however that this is an ugly hack which may break in the future.
*/
@OptIn(InternalCoroutinesApi::class)
private val delay = domain.coroutineContext[ContinuationInterceptor] as Delay
@@ -290,8 +293,6 @@ public class SimpleBareMetalDriver(
usageFlush?.dispose()
usageFlush = null
- val context = select.completion.context
-
val queue = batch.iterator()
var start = Long.MIN_VALUE
var currentWork: SliceWork? = null