summaryrefslogtreecommitdiff
path: root/simulator/opendc-utils/src/main
diff options
context:
space:
mode:
authorFabian Mastenbroek <mail.fabianm@gmail.com>2021-03-18 16:25:00 +0100
committerFabian Mastenbroek <mail.fabianm@gmail.com>2021-03-22 16:47:56 +0100
commit9dab4d7b3921cd48199d773c7dc4bae0f2273223 (patch)
tree855d7da216be486ad53258d18bbf7fa2d9d04cec /simulator/opendc-utils/src/main
parent0fa1dc262905c42b3549172fea59f7ad4cb58b1f (diff)
simulator: Re-design consumer interface to support capacity negotiation
This change re-designs the SimResourceConsumer interface to support in the future capacity negotiation. This basically means that the consumer will be informed directly when not enough capacity is available, instead of after the deadline specified by the consumer.
Diffstat (limited to 'simulator/opendc-utils/src/main')
-rw-r--r--simulator/opendc-utils/src/main/kotlin/org/opendc/utils/TimerScheduler.kt2
1 files changed, 1 insertions, 1 deletions
diff --git a/simulator/opendc-utils/src/main/kotlin/org/opendc/utils/TimerScheduler.kt b/simulator/opendc-utils/src/main/kotlin/org/opendc/utils/TimerScheduler.kt
index 49964938..d4bc7b5c 100644
--- a/simulator/opendc-utils/src/main/kotlin/org/opendc/utils/TimerScheduler.kt
+++ b/simulator/opendc-utils/src/main/kotlin/org/opendc/utils/TimerScheduler.kt
@@ -93,7 +93,7 @@ public class TimerScheduler<T>(context: CoroutineContext, private val clock: Clo
try {
timer()
} catch (e: Throwable) {
- Thread.getDefaultUncaughtExceptionHandler().uncaughtException(Thread.currentThread(), e)
+ coroutineContext[CoroutineExceptionHandler]?.handleException(coroutineContext, e)
}
}
}