scheduler.cc (13317:36c574a4036e) scheduler.cc (13328:d5f4e801436a)
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

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

160{
161 // Pull a process from the active list.
162 _current = getNextReady();
163 if (!_current) {
164 // There are no more processes, so return control to evaluate.
165 Fiber::primaryFiber()->run();
166 } else {
167 _current->popListNode();
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

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

160{
161 // Pull a process from the active list.
162 _current = getNextReady();
163 if (!_current) {
164 // There are no more processes, so return control to evaluate.
165 Fiber::primaryFiber()->run();
166 } else {
167 _current->popListNode();
168 _current->scheduled(false);
168 // Switch to whatever Fiber is supposed to run this process. All
169 // Fibers which aren't running should be parked at this line.
170 _current->fiber()->run();
171 // If the current process needs to be manually started, start it.
172 if (_current && _current->needsStart()) {
173 _current->needsStart(false);
174 // If a process hasn't started yet, "resetting" it just starts it
175 // and signals its reset event.

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

194}
195
196void
197Scheduler::ready(Process *p)
198{
199 if (_stopNow)
200 return;
201
169 // Switch to whatever Fiber is supposed to run this process. All
170 // Fibers which aren't running should be parked at this line.
171 _current->fiber()->run();
172 // If the current process needs to be manually started, start it.
173 if (_current && _current->needsStart()) {
174 _current->needsStart(false);
175 // If a process hasn't started yet, "resetting" it just starts it
176 // and signals its reset event.

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

195}
196
197void
198Scheduler::ready(Process *p)
199{
200 if (_stopNow)
201 return;
202
203 p->scheduled(true);
204
202 if (p->procKind() == ::sc_core::SC_METHOD_PROC_)
203 readyListMethods.pushLast(p);
204 else
205 readyListThreads.pushLast(p);
206
207 if (!inEvaluate())
208 scheduleReadyEvent();
209}

--- 294 unchanged lines hidden ---
205 if (p->procKind() == ::sc_core::SC_METHOD_PROC_)
206 readyListMethods.pushLast(p);
207 else
208 readyListThreads.pushLast(p);
209
210 if (!inEvaluate())
211 scheduleReadyEvent();
212}

--- 294 unchanged lines hidden ---