Changeset 12404 for trunk/Ohana/src/opihi/pantasks/CheckJobs.c
- Timestamp:
- Mar 11, 2007, 10:56:27 AM (19 years ago)
- File:
-
- 1 edited
-
trunk/Ohana/src/opihi/pantasks/CheckJobs.c (modified) (5 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/Ohana/src/opihi/pantasks/CheckJobs.c
r11898 r12404 1 1 # include "pantasks.h" 2 2 3 int CheckJobs () {3 float CheckJobs () { 4 4 5 5 FILE *f; … … 10 10 char varname[64]; 11 11 Queue *queue; 12 float time_running, next_timeout; 12 13 13 14 // int Ncheck; 14 15 // Ncheck = 0; 16 17 // actual maximum delay is controlled in job_threads.c 18 next_timeout = 1.0; 15 19 16 20 /** test all jobs: ready to test? finished? **/ … … 21 25 22 26 /* check poll period (ready to ask for status?) */ 23 if (GetTaskTimer(job[0].last, FALSE) < task[0].poll_period) continue; 27 time_running = GetTaskTimer(job[0].last, FALSE); 28 // fprintf (stderr, "next: %f, poll: %f, run: %f\n", next_timeout, task[0].poll_period, time_running); 29 if (time_running < task[0].poll_period) { 30 next_timeout = MIN (next_timeout, task[0].poll_period - time_running); 31 continue; 32 } 33 next_timeout = 0.0; 24 34 25 35 /* check current status */ … … 139 149 */ 140 150 if (job[0].mode == JOB_LOCAL) { 141 if (GetTaskTimer(job[0].start, FALSE) < task[0].timeout_period) continue; 151 if (GetTaskTimer(job[0].start, FALSE) < task[0].timeout_period) { 152 /* reset polling clock */ 153 SetTaskTimer (&job[0].last); 154 continue; 155 } 142 156 if (VerboseMode()) gprint (GP_LOG, "timeout on %s\n", task[0].name); 143 157 … … 180 194 /* reset polling clock */ 181 195 SetTaskTimer (&job[0].last); 182 if (TestElapsedCheck()) {183 // fprintf (stderr, "check %d jobs\n", Ncheck);184 return (TRUE);185 }186 196 } 187 197 // fprintf (stderr, "check %d jobs\n", Ncheck); 188 return ( TRUE);198 return (next_timeout); 189 199 } 190 200
Note:
See TracChangeset
for help on using the changeset viewer.
