Changeset 4684 for trunk/Ohana/src/opihi/pantasks/CheckJobs.c
- Timestamp:
- Jul 31, 2005, 8:04:11 AM (21 years ago)
- File:
-
- 1 edited
-
trunk/Ohana/src/opihi/pantasks/CheckJobs.c (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/Ohana/src/opihi/pantasks/CheckJobs.c
r4602 r4684 12 12 while ((job = NextJob ()) != NULL) { 13 13 14 /* check for timeout - only local jobs timeout here */ 15 if ((job[0].mode == JOB_LOCAL) && (GetTaskTimer(job[0].start) >= job[0].task[0].timeout_period)) { 16 if (VerboseMode()) fprintf (stderr, "timeout on %s\n", job[0].task[0].name); 17 /* run task[0].timeout macro, if it exists */ 18 if (job[0].task[0].timeout != NULL) { 19 exec_loop (job[0].task[0].timeout); 20 } 21 DeleteJob (job); 22 continue; 23 } 24 25 /* check poll period (ready to run again?) */ 14 /* check poll period (ready to ask for status?) */ 26 15 if (GetTaskTimer(job[0].last) < job[0].task[0].poll_period) continue; 27 16 … … 74 63 } 75 64 65 /* check for timeout - (local jobs only) 66 we only check timeout after a poll (forces at least one poll) 67 */ 68 if (job[0].mode == JOB_LOCAL) { 69 if (GetTaskTimer(job[0].start) < job[0].task[0].timeout_period) continue; 70 if (VerboseMode()) fprintf (stderr, "timeout on %s\n", job[0].task[0].name); 71 if (!KillLocalJob (job)) { 72 job[0].state = JOB_HUNG; 73 if (VerboseMode()) fprintf (stderr, "child process %d is hung, cannot kill\n", job[0].pid); 74 continue; 75 } 76 /* run task[0].timeout macro, if it exists */ 77 if (job[0].task[0].timeout != NULL) { 78 exec_loop (job[0].task[0].timeout); 79 } 80 DeleteJob (job); 81 continue; 82 } 83 76 84 /* reset polling clock */ 77 85 SetTaskTimer (&job[0].last); … … 79 87 return (TRUE); 80 88 } 89 90 /* 91 92 job / task timeline: 93 94 task: 95 0 exec 96 start create 97 task clock new job 98 99 job: 100 0 1xpoll 2xpoll 3xpoll 101 start check check check 102 job clock status status status 103 104 . . . timeout 105 run 106 timeout 107 108 must be at least one poll before timeout 109 (timeout >= poll) 110 */
Note:
See TracChangeset
for help on using the changeset viewer.
