eventq.cc (2665:a124942bacb8) eventq.cc (2667:fe64b8353b1c)
1/*
2 * Copyright (c) 2000-2005 The Regents of The University of Michigan
3 * All rights reserved.
4 *
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions are
7 * met: redistributions of source code must retain the above copyright
8 * notice, this list of conditions and the following disclaimer;

--- 88 unchanged lines hidden (view full) ---

97 prev = curr;
98 curr = curr->next;
99 }
100
101 if (curr == event)
102 prev->next = curr->next;
103}
104
1/*
2 * Copyright (c) 2000-2005 The Regents of The University of Michigan
3 * All rights reserved.
4 *
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions are
7 * met: redistributions of source code must retain the above copyright
8 * notice, this list of conditions and the following disclaimer;

--- 88 unchanged lines hidden (view full) ---

97 prev = curr;
98 curr = curr->next;
99 }
100
101 if (curr == event)
102 prev->next = curr->next;
103}
104
105void
105Event *
106EventQueue::serviceOne()
107{
108 Event *event = head;
109 event->clearFlags(Event::Scheduled);
110 head = event->next;
111
112 // handle action
106EventQueue::serviceOne()
107{
108 Event *event = head;
109 event->clearFlags(Event::Scheduled);
110 head = event->next;
111
112 // handle action
113 if (!event->squashed())
113 if (!event->squashed()) {
114 event->process();
114 event->process();
115 else
115 if (event->isExitEvent()) {
116 assert(!event->getFlags(Event::AutoDelete)); // would be silly
117 return event;
118 }
119 } else {
116 event->clearFlags(Event::Squashed);
120 event->clearFlags(Event::Squashed);
121 }
117
118 if (event->getFlags(Event::AutoDelete) && !event->scheduled())
119 delete event;
122
123 if (event->getFlags(Event::AutoDelete) && !event->scheduled())
124 delete event;
125
126 return NULL;
120}
121
122
123void
124Event::serialize(std::ostream &os)
125{
126 SERIALIZE_SCALAR(_when);
127 SERIALIZE_SCALAR(_priority);

--- 135 unchanged lines hidden ---
127}
128
129
130void
131Event::serialize(std::ostream &os)
132{
133 SERIALIZE_SCALAR(_when);
134 SERIALIZE_SCALAR(_priority);

--- 135 unchanged lines hidden ---