Deleted Added
sdiff udiff text old ( 13067:3d6ef32002ef ) new ( 13069:d894ba8f881c )
full compact
1/*
2 * Copyright 2018 Google, Inc.
3 *
4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions are
6 * met: redistributions of source code must retain the above copyright
7 * notice, this list of conditions and the following disclaimer;
8 * redistributions in binary form must reproduce the above copyright

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

220 scheduleReadyEvent();
221 return;
222 }
223
224 // Timed notification/timeout.
225 TimeSlot *&ts = timeSlots[tick];
226 if (!ts) {
227 ts = new TimeSlot;
228 if (initDone)
229 eq->schedule(ts, tick);
230 else
231 eventsToSchedule[ts] = tick;
232 }
233 ts->events.insert(event);
234 }
235
236 // For descheduling delayed/timed notifications/timeouts.
237 void
238 deschedule(ScEvent *event)
239 {

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

250 "Descheduling event at time with no events.");
251 TimeSlot *ts = tsit->second;
252 ScEvents &events = ts->events;
253 events.erase(event);
254 event->deschedule();
255
256 // If no more events are happening at this time slot, get rid of it.
257 if (events.empty()) {
258 if (initDone)
259 eq->deschedule(ts);
260 else
261 eventsToSchedule.erase(ts);
262 timeSlots.erase(tsit);
263 }
264 }
265
266 void
267 completeTimeSlot(TimeSlot *ts)
268 {
269 assert(ts == timeSlots.begin()->second);

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

323 static Priority StopPriority = DefaultPriority - 1;
324 static Priority PausePriority = DefaultPriority + 1;
325 static Priority MaxTickPriority = DefaultPriority + 2;
326 static Priority ReadyPriority = DefaultPriority + 3;
327 static Priority StarvationPriority = ReadyPriority;
328
329 EventQueue *eq;
330
331 ScEvents deltas;
332 TimeSlots timeSlots;
333
334 void runReady();
335 EventWrapper<Scheduler, &Scheduler::runReady> readyEvent;
336 void scheduleReadyEvent();
337
338 void pause();

--- 52 unchanged lines hidden ---