*** empty log message ***

svn path=/trunk/boinc/; revision=6219
This commit is contained in:
David Anderson 2005-05-22 23:12:09 +00:00
parent c1f9461305
commit 12b192bb53
4 changed files with 33 additions and 9 deletions

View File

@ -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

View File

@ -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

View File

@ -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<active_tasks.active_tasks.size(); i++) {
atp = active_tasks.active_tasks[i];

View File

@ -26,6 +26,9 @@
#include "ss_logic.h"
#include "util.h"
#define SS_CHANGE_PERIOD 600
// if > 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) {