summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/sim/eventq.cc8
-rw-r--r--src/sim/eventq.hh10
2 files changed, 18 insertions, 0 deletions
diff --git a/src/sim/eventq.cc b/src/sim/eventq.cc
index 78524fe51..b389efcf2 100644
--- a/src/sim/eventq.cc
+++ b/src/sim/eventq.cc
@@ -373,6 +373,14 @@ EventQueue::debugVerify() const
return true;
}
+Event*
+EventQueue::replaceHead(Event* s)
+{
+ Event* t = head;
+ head = s;
+ return t;
+}
+
void
dumpMainQueue()
{
diff --git a/src/sim/eventq.hh b/src/sim/eventq.hh
index 1509d05a5..6dc25e760 100644
--- a/src/sim/eventq.hh
+++ b/src/sim/eventq.hh
@@ -408,6 +408,16 @@ class EventQueue : public Serializable
bool debugVerify() const;
+ /**
+ * function for replacing the head of the event queue, so that a
+ * different set of events can run without disturbing events that have
+ * already been scheduled. Already scheduled events can be processed
+ * by replacing the original head back.
+ * USING THIS FUNCTION CAN BE DANGEROUS TO THE HEALTH OF THE SIMULATOR.
+ * NOT RECOMMENDED FOR USE.
+ */
+ Event* replaceHead(Event* s);
+
#ifndef SWIG
virtual void serialize(std::ostream &os);
virtual void unserialize(Checkpoint *cp, const std::string &section);