- // but if you are doing this on intervals, don't forget to make another
- if (repeat) {
- assert(getFlags(IsMainQueue));
- mainEventQueue.schedule(this, curTick + repeat);
- }
+ new GlobalSimLoopExitEvent(when + simQuantum, message, exit_code, repeat);
+}
+
+void
+exitSimLoopNow(const std::string &message, int exit_code, Tick repeat,
+ bool serialize)
+{
+ new GlobalSimLoopExitEvent(message, exit_code, repeat);
+}
+
+LocalSimLoopExitEvent::LocalSimLoopExitEvent(const std::string &_cause, int c,
+ Tick r)
+ : Event(Sim_Exit_Pri, IsExitEvent),
+ cause(_cause), code(c), repeat(r)
+{
+}
+
+//
+// handle termination event
+//
+void
+LocalSimLoopExitEvent::process()
+{
+ exitSimLoop(cause, 0);