diff options
Diffstat (limited to 'opendc-simulator/opendc-simulator-compute/src/main')
| -rw-r--r-- | opendc-simulator/opendc-simulator-compute/src/main/kotlin/org/opendc/simulator/compute/Coroutines.kt | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/opendc-simulator/opendc-simulator-compute/src/main/kotlin/org/opendc/simulator/compute/Coroutines.kt b/opendc-simulator/opendc-simulator-compute/src/main/kotlin/org/opendc/simulator/compute/Coroutines.kt index b354caff..63af2048 100644 --- a/opendc-simulator/opendc-simulator-compute/src/main/kotlin/org/opendc/simulator/compute/Coroutines.kt +++ b/opendc-simulator/opendc-simulator-compute/src/main/kotlin/org/opendc/simulator/compute/Coroutines.kt @@ -35,7 +35,10 @@ import kotlin.coroutines.resumeWithException * @return A [SimMachineContext] that represents the execution context for the workload. * @throws IllegalStateException if a workload is already active on the machine or if the machine is closed. */ -public suspend fun SimMachine.runWorkload(workload: SimWorkload, meta: Map<String, Any> = emptyMap()) { +public suspend fun SimMachine.runWorkload( + workload: SimWorkload, + meta: Map<String, Any> = emptyMap(), +) { return suspendCancellableCoroutine { cont -> cont.invokeOnCancellation { this@runWorkload.cancel() } |
