From 82433be1e8e2b14445e64c276588703d7b648212 Mon Sep 17 00:00:00 2001 From: David Anderson Date: Fri, 7 Nov 2003 06:17:57 +0000 Subject: [PATCH] *** empty log message *** svn path=/trunk/boinc/; revision=2641 --- api/boinc_api.C | 8 +++++++- checkin_notes | 8 ++++++++ 2 files changed, 15 insertions(+), 1 deletion(-) diff --git a/api/boinc_api.C b/api/boinc_api.C index 59b74d1f2c..c2be0defcf 100644 --- a/api/boinc_api.C +++ b/api/boinc_api.C @@ -71,6 +71,7 @@ static bool this_process_active; static bool time_to_quit = false; static double last_wu_cpu_time; static bool standalone = false; +static double initial_wu_cpu_time; APP_CLIENT_SHM *app_client_shm; @@ -331,7 +332,7 @@ static void on_timer(int a) { double cur_cpu; double cur_mem; boinc_worker_thread_cpu_time(cur_cpu, cur_mem); - last_wu_cpu_time = cur_cpu + aid.wu_cpu_time; + last_wu_cpu_time = cur_cpu + initial_wu_cpu_time; update_app_progress(fraction_done, last_wu_cpu_time, last_checkpoint_cpu_time, cur_mem); time_until_fraction_done_update = aid.fraction_done_update_period; } @@ -446,6 +447,11 @@ int boinc_init(bool standalone_ /* = false */) { retval = boinc_parse_init_data_file(); if (retval) return retval; + // copy the WU CPU time to a separate var, + // since we may reread the structure again later. + // + initial_wu_cpu_time = aid.wu_cpu_time; + f = fopen(FD_INIT_FILE, "r"); if (f) { parse_fd_init_file(f); diff --git a/checkin_notes b/checkin_notes index 3065055529..db04d76ee2 100755 --- a/checkin_notes +++ b/checkin_notes @@ -7560,3 +7560,11 @@ Eric 7 Nov 2003 api/boinc_api.C apps/upper_case.C +David 6 Nov 2003 (note: Eric's on the other side of the Int. Date Line) + - Fixed bug that cause CPU time to jump whenever Get Preferences. + It's because the app is getting a new aid.wu_cpu_time + as part of reread_prefs; this is incorrectly added to the thread's CPU time. + Solution: make a copy of aid.wu_cpu_time at startup and use the copy. + + api/ + boinc_api.C