IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
May 30, 2007, 12:13:00 PM (19 years ago)
Author:
eugene
Message:

added flush jobs command

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/Ohana/src/opihi/pantasks/JobOps.c

    r13486 r13540  
    215215    ActiveJob --;
    216216  }
     217
     218  job[0].task[0].Npending --;
     219  return (TRUE);
     220}
     221
     222int FlushJobs () {
     223
     224  int i;
     225
     226  // kill outstanding jobs
     227  for (i = 0; i < Njobs; i++) {
     228    if (jobs[i][0].mode == JOB_LOCAL) {
     229      if (!KillLocalJob (jobs[i])) {
     230        jobs[i][0].state = JOB_HUNG;
     231        if (VerboseMode()) gprint (GP_LOG, "child process %d is hung, cannot kill\n", jobs[i][0].pid);
     232      }
     233    } else {
     234      if (!KillControllerJob (jobs[i])) {
     235        jobs[i][0].state = JOB_HUNG;
     236        if (VerboseMode()) gprint (GP_LOG, "child process %d is hung, cannot kill\n", jobs[i][0].pid);
     237      }
     238    }   
     239    jobs[i][0].task[0].Npending = 0;
     240    FreeJob (jobs[i]);
     241  }
     242   
     243  Njobs = 0;
     244  NJOBS = 20;
     245  REALLOCATE (jobs, Job *, NJOBS);
     246  ActiveJob = -1;
    217247  return (TRUE);
    218248}
Note: See TracChangeset for help on using the changeset viewer.