client: fix bug where get_screensaver_tasks GUI RPC returned no tasks during CPU throttling

This commit is contained in:
David Anderson 2014-03-25 11:53:22 -07:00
parent 9faa9e6e55
commit 8a6b77ef59
2 changed files with 6 additions and 4 deletions

View File

@ -599,8 +599,7 @@ static void handle_get_screensaver_tasks(GUI_RPC_CONN& grc) {
);
for (i=0; i<gstate.active_tasks.active_tasks.size(); i++) {
atp = gstate.active_tasks.active_tasks[i];
if ((atp->task_state() == PROCESS_EXECUTING) ||
((atp->task_state() == PROCESS_SUSPENDED) && (gstate.suspend_reason == SUSPEND_REASON_CPU_THROTTLE))) {
if (atp->scheduler_state == CPU_SCHED_SCHEDULED) {
atp->result->write_gui(grc.mfout);
}
}

View File

@ -92,8 +92,11 @@
// (used internally within the client;
// changed to MSG_USER_ALERT before passing to manager)
// bitmap defs for task_suspend_reason, network_suspend_reason
// Note: doesn't need to be a bitmap, but keep for compatibility
// values for suspend_reason, network_suspend_reason
// Notes:
// - doesn't need to be a bitmap, but keep for compatibility
// - with new CPU throttling implementation (separate thread)
// CLIENT_STATE.suspend_reason will never be SUSPEND_REASON_CPU_THROTTLE.
//
enum SUSPEND_REASON {
SUSPEND_REASON_BATTERIES = 1,