Deleted Added
sdiff udiff text old ( 13133:41d8cd260825 ) new ( 13140:ecd8a58f3884 )
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

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

41Scheduler::Scheduler() :
42 eq(nullptr), readyEvent(this, false, ReadyPriority),
43 pauseEvent(this, false, PausePriority),
44 stopEvent(this, false, StopPriority),
45 scMain(nullptr),
46 starvationEvent(this, false, StarvationPriority),
47 _started(false), _paused(false), _stopped(false),
48 maxTickEvent(this, false, MaxTickPriority),
49 _numCycles(0), _current(nullptr), initDone(false),
50 runOnce(false)
51{}
52
53Scheduler::~Scheduler()
54{
55 // Clear out everything that belongs to us to make sure nobody tries to
56 // clear themselves out after the scheduler goes away.
57 clear();

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

260 deschedule(&readyEvent);
261 }
262}
263
264void
265Scheduler::runReady()
266{
267 bool empty = readyList.empty();
268
269 // The evaluation phase.
270 do {
271 yield();
272 } while (!readyList.empty());
273
274 if (!empty)
275 _numCycles++;
276
277 // The update phase.
278 update();
279
280 // The delta phase.
281 for (auto &e: deltas)
282 e->run();
283 deltas.clear();

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

329 scMain = Fiber::currentFiber();
330
331 _started = true;
332 _paused = false;
333 _stopped = false;
334 runToTime = run_to_time;
335
336 maxTick = max_tick;
337
338 if (initDone) {
339 if (!runToTime && starved())
340 scheduleStarvationEvent();
341 kernel->status(::sc_core::SC_RUNNING);
342 }
343
344 schedule(&maxTickEvent, maxTick);

--- 48 unchanged lines hidden ---