Lines Matching refs:event

97 Event::insertBefore(Event *event, Event *curr)
99 // Either way, event will be the top element in the 'in bin' list
102 if (!curr || *event < *curr) {
103 // Insert the event before the current list since it is in the future.
104 event->nextBin = curr;
105 event->nextInBin = NULL;
108 event->nextBin = curr->nextBin; // curr->nextBin can now become stale
110 // Insert event at the top of the stack
111 event->nextInBin = curr;
114 return event;
118 EventQueue::insert(Event *event)
121 if (!head || *event <= *head) {
122 head = Event::insertBefore(event, head);
130 while (curr && *curr < *event) {
137 prev->nextBin = Event::insertBefore(event, curr);
141 Event::removeItem(Event *event, Event *top)
149 if (event == top) {
157 // keep checking event against the next element.
158 while (event != next) {
160 panic("event not found!");
172 EventQueue::remove(Event *event)
175 panic("event not found!");
177 assert(event->queue == this);
179 // deal with an event on the head's 'in bin' list (event has the same
181 if (*head == *event) {
182 head = Event::removeItem(event, head);
186 // Find the 'in bin' list that this event belongs on
189 while (curr && *curr < *event) {
194 if (!curr || *curr != *event)
195 panic("event not found!");
200 prev->nextBin = Event::removeItem(event, curr);
207 Event *event = head;
209 event->flags.clear(Event::Scheduled);
224 if (!event->squashed()) {
225 // forward current cycle to the time when this event occurs.
226 setCurTick(event->when());
228 event->process();
229 if (event->isExitEvent()) {
230 assert(!event->flags.isSet(Event::Managed) ||
231 !event->flags.isSet(Event::IsMainQueue)); // would be silly
232 return event;
235 event->flags.clear(Event::Squashed);
238 event->release();
273 // need to see if original event was in a scheduled, unsquashed
285 EventQueue::checkpointReschedule(Event *event)
290 if (event->flags.isSet(Event::Scheduled))
291 insert(event);
395 DPRINTFN("%s event %s @ %d\n", description(), action, when());
422 EventQueue::asyncInsert(Event *event)
425 async_queue.push_back(event);