scheduler.cc (13703:bedf6da29c9b) scheduler.cc (13901:b9329102b1d8)
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

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

253Scheduler::requestUpdate(Channel *c)
254{
255 updateList.pushLast(c);
256 if (!inEvaluate())
257 scheduleReadyEvent();
258}
259
260void
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

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

253Scheduler::requestUpdate(Channel *c)
254{
255 updateList.pushLast(c);
256 if (!inEvaluate())
257 scheduleReadyEvent();
258}
259
260void
261Scheduler::asyncRequestUpdate(Channel *c)
262{
263 std::lock_guard<std::mutex> lock(asyncListMutex);
264 asyncUpdateList.pushLast(c);
265}
266
267void
261Scheduler::scheduleReadyEvent()
262{
263 // Schedule the evaluate and update phases.
264 if (!readyEvent.scheduled()) {
265 schedule(&readyEvent);
266 if (starvationEvent.scheduled())
267 deschedule(&starvationEvent);
268 }

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

316
317 status(StatusOther);
318}
319
320void
321Scheduler::runUpdate()
322{
323 status(StatusUpdate);
268Scheduler::scheduleReadyEvent()
269{
270 // Schedule the evaluate and update phases.
271 if (!readyEvent.scheduled()) {
272 schedule(&readyEvent);
273 if (starvationEvent.scheduled())
274 deschedule(&starvationEvent);
275 }

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

323
324 status(StatusOther);
325}
326
327void
328Scheduler::runUpdate()
329{
330 status(StatusUpdate);
331 {
332 std::lock_guard<std::mutex> lock(asyncListMutex);
333 Channel *channel;
334 while ((channel = asyncUpdateList.getNext()) != nullptr)
335 updateList.pushLast(channel);
336 }
324
325 try {
326 Channel *channel = updateList.getNext();
327 while (channel) {
328 channel->popListNode();
329 channel->update();
330 channel = updateList.getNext();
331 }

--- 195 unchanged lines hidden ---
337
338 try {
339 Channel *channel = updateList.getNext();
340 while (channel) {
341 channel->popListNode();
342 channel->update();
343 channel = updateList.getNext();
344 }

--- 195 unchanged lines hidden ---