From 12b192bb53de732d1797b8e738d475197b37be1d Mon Sep 17 00:00:00 2001 From: David Anderson Date: Sun, 22 May 2005 23:12:09 +0000 Subject: [PATCH] *** empty log message *** svn path=/trunk/boinc/; revision=6219 --- api/boinc_api.C | 2 ++ checkin_notes | 11 +++++++++++ client/app_graphics.C | 5 ++--- client/ss_logic.C | 24 ++++++++++++++++++------ 4 files changed, 33 insertions(+), 9 deletions(-) diff --git a/api/boinc_api.C b/api/boinc_api.C index b948ebe09a..309a667f7a 100644 --- a/api/boinc_api.C +++ b/api/boinc_api.C @@ -607,6 +607,7 @@ static void worker_timer(int /*a*/) { #endif } +#ifndef _WIN32 #ifndef _USECONDS_T_DECLARED typedef unsigned int useconds_t; #endif @@ -618,6 +619,7 @@ void * timer_thread(void *) { } /*NOTREACHED*/ } +#endif // set up a periodic timer interrupt for the worker thread. // This is called only and always by the worker thread diff --git a/checkin_notes b/checkin_notes index 6b1988de09..0d5bdb2477 100755 --- a/checkin_notes +++ b/checkin_notes @@ -6912,3 +6912,14 @@ David 22 May 2005 api/ boinc_api.C graphics_impl.C + +David 22 May 2005 + - screensaver logic: if > 1 apps are running (e.g. multiprocessor) + switch between them every 10 minutes + - compile fix for Win + + api/ + boinc_api.C + client/ + app_graphics.C + ss_logic.C diff --git a/client/app_graphics.C b/client/app_graphics.C index 90ab36774c..3ee259f7e4 100644 --- a/client/app_graphics.C +++ b/client/app_graphics.C @@ -186,9 +186,8 @@ ACTIVE_TASK* CLIENT_STATE::get_next_graphics_capable_app() { PROJECT *p; SCOPE_MSG_LOG scope_messages(log_messages, CLIENT_MSG_LOG::DEBUG_SCRSAVE); - // check to see if the applications have changed the graphics ack - // since they were first started, this can happen if their is a - // failure to find the target desktop + // check to see if the applications have changed the graphics mode; + // this can happen if they fail to find the target desktop // for (i=0; i 1 CPUs, change screensaver every 600 secs + SS_LOGIC::SS_LOGIC() { do_ss = false; blank_time = 0; @@ -49,8 +52,6 @@ void SS_LOGIC::ask_app(ACTIVE_TASK* atp, GRAPHICS_MSG& m) { // Start providing screensaver graphics // void SS_LOGIC::start_ss(GRAPHICS_MSG& m, double new_blank_time) { - ACTIVE_TASK* atp; - if (do_ss) return; do_ss = true; ss_status = SS_STATUS_ENABLED; @@ -97,9 +98,10 @@ void SS_LOGIC::reset() { // called 10X per second // void SS_LOGIC::poll(double now) { - ACTIVE_TASK* atp; + ACTIVE_TASK* atp, *new_atp; GRAPHICS_MSG m; static double last_time=0; + static double ss_change_time = 0; SCOPE_MSG_LOG scope_messages(log_messages, CLIENT_MSG_LOG::DEBUG_SCRSAVE); double dt = now - last_time; @@ -138,6 +140,11 @@ void SS_LOGIC::poll(double now) { if (atp->scheduler_state != CPU_SCHED_SCHEDULED) { scope_messages.printf("SS_LOGIC::poll(): app %s not scheduled\n", atp->result->name); stop_app_ss = true; + } else if (now-ss_change_time > SS_CHANGE_PERIOD) { + new_atp = gstate.get_next_graphics_capable_app(); + if (new_atp && (new_atp != atp)) { + stop_app_ss = true; + } } } else { if (dtime() > ack_deadline) { @@ -150,8 +157,7 @@ void SS_LOGIC::poll(double now) { } if (!stop_app_ss) return; - // app failed to go into fullscreen, or is preempted. - // tell it not to do SSG + // tell app not to do SSG any more // m.mode = MODE_HIDE_GRAPHICS; atp->request_graphics_mode(m); @@ -161,10 +167,16 @@ void SS_LOGIC::poll(double now) { // here if no app currently doing SSG // try to find one. // - atp = gstate.get_next_graphics_capable_app(); + if (new_atp) { + atp = new_atp; + } else { + atp = gstate.get_next_graphics_capable_app(); + } + if (atp) { scope_messages.printf("SS_LOGIC::poll(): picked %s, request restart\n", atp->result->name); ask_app(atp, saved_graphics_msg); + ss_change_time = now; } else { scope_messages.printf("SS_LOGIC::poll(): no app found\n"); if (gstate.active_tasks.active_tasks.size()==0) {