summaryrefslogtreecommitdiff
path: root/src/sim
diff options
context:
space:
mode:
authorSteve Reinhardt <stever@eecs.umich.edu>2007-05-20 21:43:01 -0700
committerSteve Reinhardt <stever@eecs.umich.edu>2007-05-20 21:43:01 -0700
commit05d14cf3e258bc414695711e6d7303cf31e72fa3 (patch)
treec812e65ee4e23df158dd021368592bd27fb22cb7 /src/sim
parent87adc37e91784575d44572d2520b1adf115fc931 (diff)
downloadgem5-05d14cf3e258bc414695711e6d7303cf31e72fa3.tar.xz
Add new EventWrapper constructor that takes a Tick value
and schedules the event immediately. --HG-- extra : convert_revision : a84e729a5ef3632cbe6cff858c453c782707d983
Diffstat (limited to 'src/sim')
-rw-r--r--src/sim/eventq.hh14
1 files changed, 13 insertions, 1 deletions
diff --git a/src/sim/eventq.hh b/src/sim/eventq.hh
index 974313968..6fbba46d5 100644
--- a/src/sim/eventq.hh
+++ b/src/sim/eventq.hh
@@ -293,13 +293,25 @@ class EventWrapper : public Event
T *object;
public:
- EventWrapper(T *obj, bool del = false, EventQueue *q = &mainEventQueue,
+ EventWrapper(T *obj, bool del = false,
+ EventQueue *q = &mainEventQueue,
Priority p = Default_Pri)
: Event(q, p), object(obj)
{
if (del)
setFlags(AutoDelete);
}
+
+ EventWrapper(T *obj, Tick t, bool del = false,
+ EventQueue *q = &mainEventQueue,
+ Priority p = Default_Pri)
+ : Event(q, p), object(obj)
+ {
+ if (del)
+ setFlags(AutoDelete);
+ schedule(t);
+ }
+
void process() { (object->*F)(); }
};