*** empty log message ***

svn path=/trunk/boinc/; revision=369
This commit is contained in:
David Anderson 2002-08-22 22:28:51 +00:00
parent b0ac995315
commit 9fc8f33c2f
10 changed files with 34 additions and 17 deletions

View File

@ -380,7 +380,7 @@ int ACTIVE_TASK_SET::insert(ACTIVE_TASK* atp) {
// Checks if any child processes have exited and records their final CPU time
//
bool ACTIVE_TASK_SET::poll() {
ACTIVE_TASK* atp = NULL;
ACTIVE_TASK* atp;
char path[256];
int n;
@ -390,10 +390,12 @@ bool ACTIVE_TASK_SET::poll() {
FILETIME creation_time, exit_time, kernel_time, user_time;
ULARGE_INTEGER tKernel, tUser;
LONGLONG totTime;
bool found = false;
for (i=0; i<active_tasks.size(); i++) {
atp = active_tasks[i];
if (GetExitCodeProcess(atp->pid_handle, &exit_code)) {
found = true;
// Get the elapsed CPU time
if (GetProcessTimes(atp->pid_handle, &creation_time, &exit_time, &kernel_time, &user_time)) {
tKernel.LowPart = kernel_time.dwLowDateTime;
@ -416,14 +418,11 @@ bool ACTIVE_TASK_SET::poll() {
atp->exit_status = exit_code;
atp->result->exit_status = atp->exit_status;
}
} else {
// Not sure what to do here
}
}
if( atp == NULL ) {
return false;
}
if (log_flags.task_debug && found) printf("ACTIVE_TASK_SET::poll\n");
return found;
#endif
#if HAVE_SYS_RESOURCE_H
@ -473,6 +472,7 @@ bool ACTIVE_TASK_SET::poll() {
clean_out_dir(atp->dirname);
if (log_flags.task_debug) printf("ACTIVE_TASK_SET::poll\n");
return true;
}
@ -639,10 +639,12 @@ bool ACTIVE_TASK_SET::poll_time() {
unsigned int i;
bool updated = false;
for(i=0; i<active_tasks.size(); i++) {
for (i=0; i<active_tasks.size(); i++) {
atp = active_tasks[i];
updated |= atp->check_app_status_files();
}
if (log_flags.task_debug && updated) printf("ACTIVE_TASK_SET::poll_time\n");
return updated;
}

View File

@ -700,6 +700,7 @@ bool CLIENT_STATE::garbage_collect() {
// TODO: delete obsolete APP_VERSIONs
if (log_flags.state_debug && action) printf("garbage_collect\n");
return action;
}
@ -750,6 +751,7 @@ bool CLIENT_STATE::update_results() {
}
result_iter++;
}
if (log_flags.state_debug && action) printf("update_results\n");
return action;
}

View File

@ -113,6 +113,7 @@ bool CLIENT_STATE::handle_running_apps() {
action = true;
}
}
if (log_flags.task_debug && action) printf("CS::handle_running_apps\n");
return action;
}

View File

@ -127,5 +127,6 @@ bool CLIENT_STATE::handle_pers_file_xfers() {
}
}
if (log_flags.file_xfer_debug && action) printf("CS::handle_pers_file_xfers\n");
return action;
}

View File

@ -219,5 +219,8 @@ bool FILE_XFER_SET::poll() {
}
}
}
if (log_flags.file_xfer_debug) {
if (action) printf("FILE_XFER_SET poll true\n");
}
return action;
}

View File

@ -189,6 +189,9 @@ int NET_XFER_SET::poll(int max_bytes, int& bytes_transferred) {
bytes_transferred += n;
if (max_bytes < 0) break;
}
if (log_flags.net_xfer_debug && bytes_transferred) {
printf("NET_XFER_SET::poll bytes_transferred %d\n", bytes_transferred);
}
return 0;
}
@ -341,9 +344,9 @@ int NET_XFER::do_xfer(int& nbytes_transferred) {
offset = 0;
while (nleft) {
#ifdef _WIN32
n = send(socket, buf+offset, nleft, 0);
n = send(socket, buf+offset, nleft, 0);
#else
n = write(socket, buf+offset, nleft);
n = write(socket, buf+offset, nleft);
#endif
if (log_flags.net_xfer_debug) {
printf("wrote %d bytes to socket %d\n", n, socket);

View File

@ -260,6 +260,7 @@ bool PERS_FILE_XFER_SET::poll() {
if (action) gstate.set_client_state_dirty("pers_file_xfer_set poll");
if (log_flags.file_xfer_debug && action) printf("PERS_FILE_XFER_SET::poll\n");
return action;
}

View File

@ -35,11 +35,11 @@ PREFS::PREFS() {
dont_run_on_batteries = false;
dont_run_if_user_active = false;
confirm_before_connecting = false;
high_water_days = false;
low_water_days = false;
disk_max_used_gb = 0;
disk_max_used_pct = 0;
disk_min_free_gb = 0;
high_water_days = 3;
low_water_days = 1;
disk_max_used_gb = 1;
disk_max_used_pct = 0.5;
disk_min_free_gb = 0.1;
};
// Parse XML based prefs, usually from prefs.xml

View File

@ -203,16 +203,18 @@ bool SCHEDULER_OP::update_urls(PROJECT& project, vector<STRING256> &urls) {
// poll routine. If an operation is in progress, check for completion
//
int SCHEDULER_OP::poll() {
bool SCHEDULER_OP::poll() {
int retval;
vector<STRING256> urls;
bool changed, scheduler_op_done;
bool action = false;
switch(state) {
case SCHEDULER_OP_STATE_GET_MASTER:
// here we're fetching the master file for a project
//
if (http_op.http_op_state == HTTP_STATE_DONE) {
action = true;
project->master_url_fetch_pending = false;
http_ops->remove(&http_op);
if (http_op.http_op_retval == 0) {
@ -263,6 +265,7 @@ int SCHEDULER_OP::poll() {
//
scheduler_op_done = false;
if (http_op.http_op_state == HTTP_STATE_DONE) {
action = true;
http_ops->remove(&http_op);
if (http_op.http_op_retval) {
if (log_flags.sched_op_debug) {
@ -330,7 +333,8 @@ int SCHEDULER_OP::poll() {
default:
break;
}
return 0;
if (log_flags.sched_op_debug && action) printf("SCHEDULER_OP::poll\n);
return action;
}
SCHEDULER_REPLY::SCHEDULER_REPLY() {

View File

@ -58,7 +58,7 @@ struct SCHEDULER_OP {
unsigned int url_index; // index within project's URL list
SCHEDULER_OP(HTTP_OP_SET*);
int poll();
bool poll();
int init_get_work();
int init_return_results(PROJECT*, double nsecs);
int init_op_project(double ns);