summaryrefslogtreecommitdiff
path: root/src/sim/eventq.cc
diff options
context:
space:
mode:
Diffstat (limited to 'src/sim/eventq.cc')
-rw-r--r--src/sim/eventq.cc13
1 files changed, 10 insertions, 3 deletions
diff --git a/src/sim/eventq.cc b/src/sim/eventq.cc
index d90d0923a..6ae838897 100644
--- a/src/sim/eventq.cc
+++ b/src/sim/eventq.cc
@@ -102,7 +102,7 @@ EventQueue::remove(Event *event)
prev->next = curr->next;
}
-void
+Event *
EventQueue::serviceOne()
{
Event *event = head;
@@ -110,13 +110,20 @@ EventQueue::serviceOne()
head = event->next;
// handle action
- if (!event->squashed())
+ if (!event->squashed()) {
event->process();
- else
+ if (event->isExitEvent()) {
+ assert(!event->getFlags(Event::AutoDelete)); // would be silly
+ return event;
+ }
+ } else {
event->clearFlags(Event::Squashed);
+ }
if (event->getFlags(Event::AutoDelete) && !event->scheduled())
delete event;
+
+ return NULL;
}