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
--- 179 unchanged lines hidden (view full) ---
188 if (_stopNow)
189 return;
190
191 if (p->procKind() == ::sc_core::SC_METHOD_PROC_)
192 readyListMethods.pushLast(p);
193 else
194 readyListThreads.pushLast(p);
195
196 scheduleReadyEvent();
197}
198
199void
200Scheduler::resume(Process *p)
201{
202 if (initDone)
203 ready(p);
204 else
--- 24 unchanged lines hidden (view full) ---
229 }
230 return was_ready;
231}
232
233void
234Scheduler::requestUpdate(Channel *c)
235{
236 updateList.pushLast(c);
237 scheduleReadyEvent();
238}
239
240void
241Scheduler::scheduleReadyEvent()
242{
243 // Schedule the evaluate and update phases.
244 if (!readyEvent.scheduled()) {
245 schedule(&readyEvent);
--- 23 unchanged lines hidden (view full) ---
269 yield();
270 } while (getNextReady());
271
272 if (!empty) {
273 _numCycles++;
274 _changeStamp++;
275 }
276
277 if (_stopNow)
278 return;
279
280 runUpdate();
281 runDelta();
282
283 if (!runToTime && starved())
284 scheduleStarvationEvent();
285
286 if (runOnce)
--- 186 unchanged lines hidden ---
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
--- 179 unchanged lines hidden (view full) ---
188 if (_stopNow)
189 return;
190
191 if (p->procKind() == ::sc_core::SC_METHOD_PROC_)
192 readyListMethods.pushLast(p);
193 else
194 readyListThreads.pushLast(p);
195
196 scheduleReadyEvent();
197}
198
199void
200Scheduler::resume(Process *p)
201{
202 if (initDone)
203 ready(p);
204 else
--- 24 unchanged lines hidden (view full) ---
229 }
230 return was_ready;
231}
232
233void
234Scheduler::requestUpdate(Channel *c)
235{
236 updateList.pushLast(c);
237 scheduleReadyEvent();
238}
239
240void
241Scheduler::scheduleReadyEvent()
242{
243 // Schedule the evaluate and update phases.
244 if (!readyEvent.scheduled()) {
245 schedule(&readyEvent);
--- 23 unchanged lines hidden (view full) ---
269 yield();
270 } while (getNextReady());
271
272 if (!empty) {
273 _numCycles++;
274 _changeStamp++;
275 }
276
277 if (_stopNow)
278 return;
279
280 runUpdate();
281 runDelta();
282
283 if (!runToTime && starved())
284 scheduleStarvationEvent();
285
286 if (runOnce)
--- 186 unchanged lines hidden ---