diff options
Diffstat (limited to 'simulator/opendc-compute')
| -rw-r--r-- | simulator/opendc-compute/opendc-compute-simulator/src/main/kotlin/org/opendc/compute/simulator/SimHost.kt | 8 |
1 files changed, 2 insertions, 6 deletions
diff --git a/simulator/opendc-compute/opendc-compute-simulator/src/main/kotlin/org/opendc/compute/simulator/SimHost.kt b/simulator/opendc-compute/opendc-compute-simulator/src/main/kotlin/org/opendc/compute/simulator/SimHost.kt index ea775efc..6d87e444 100644 --- a/simulator/opendc-compute/opendc-compute-simulator/src/main/kotlin/org/opendc/compute/simulator/SimHost.kt +++ b/simulator/opendc-compute/opendc-compute-simulator/src/main/kotlin/org/opendc/compute/simulator/SimHost.kt @@ -296,7 +296,6 @@ public class SimHost( override fun close() { scope.cancel() machine.close() - _state = HostState.DOWN } override fun toString(): String = "SimHost[uid=$uid,name=$name,model=$model]" @@ -389,7 +388,7 @@ public class SimHost( assert(job == null) { "Concurrent job running" } val workload = mapper.createWorkload(server) - val job = scope.launch { + job = scope.launch { delay(1) // TODO Introduce boot time init() cont.resume(Unit) @@ -400,12 +399,9 @@ public class SimHost( exit(cause) } finally { machine.close() + job = null } } - this.job = job - job.invokeOnCompletion { - this.job = null - } } private fun init() { |
