*** empty log message ***

svn path=/trunk/boinc/; revision=3214
This commit is contained in:
David Anderson 2004-04-03 01:26:40 +00:00
parent 014ab3926d
commit 9b9d47e177
1 changed files with 48 additions and 50 deletions

View File

@ -552,6 +552,10 @@ pid_t wait4(pid_t pid, int *statusp, int options, struct rusage *rusagep) {
}
#endif
// We have sent a quit signal to the process; see if it's exited.
// This is called when the core client exits,
// or when a project is detached or reset
//
bool ACTIVE_TASK::task_exited() {
bool exited = false;
if (state != PROCESS_RUNNING) return true;
@ -569,11 +573,6 @@ bool ACTIVE_TASK::task_exited() {
my_pid = wait4(pid, &stat, WNOHANG, &rs);
if (my_pid == pid) {
exited = true;
// Is the following necessary??
double x = rs.ru_utime.tv_sec + rs.ru_utime.tv_usec/1.e6;
result->final_cpu_time = current_cpu_time =
checkpoint_cpu_time = starting_cpu_time + x;
}
#endif
if (exited) {
@ -904,10 +903,11 @@ void ACTIVE_TASK::check_graphics_mode_ack() {
}
// send quit signal to all tasks in the project
// (or all tasks, if zero).
// If they don't exit in 5, send them a kill signal
// and wait up to 5 more seconds to exit.
// TODO: unsuspend active tasks so they have a chance to checkpoint
// (or all tasks, if proj==0).
// If they don't exit in 5 seconds,
// send them a kill signal and wait up to 5 more seconds to exit.
// This is called when the core client exits,
// or when a project is detached or reset
//
int ACTIVE_TASK_SET::exit_tasks(PROJECT* proj) {
request_tasks_exit(proj);
@ -1034,6 +1034,8 @@ void ACTIVE_TASK_SET::unsuspend_all() {
}
// Send quit signal to all currently running tasks
// This is called when the core client exits,
// or when a project is detached or reset
//
void ACTIVE_TASK_SET::request_tasks_exit(PROJECT* proj) {
unsigned int i;
@ -1300,8 +1302,6 @@ int ACTIVE_TASK_SET::get_free_slot(int total_slots) {
return -1;
}
// Write XML data about this ACTIVE_TASK
//
int ACTIVE_TASK::write(FILE* fout) {
fprintf(fout,
"<active_task>\n"
@ -1324,8 +1324,6 @@ int ACTIVE_TASK::write(FILE* fout) {
return 0;
}
// Parse XML information about an active task
//
int ACTIVE_TASK::parse(FILE* fin, CLIENT_STATE* cs) {
char buf[256], result_name[256], project_master_url[256];
int app_version_num=0;