IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Aug 18, 2006, 1:44:51 PM (20 years ago)
Author:
eugene
Message:

successful implementation of the threaded version of pcontrol

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/Ohana/src/opihi/pcontrol/CheckDoneJob.c

    r8296 r8424  
    11# include "pcontrol.h"
    22
    3 int CheckDoneJob (Job *job) {
     3int CheckDoneJob (Job *job, Host *host) {
    44 
    5   Host *host;
     5  int success;
    66
    7   if (!GetJobOutput ("stdout", (Host *) job[0].host, &job[0].stdout, job[0].stdout_size)) {
    8     /* strip off first and last lines */
    9     PutJob (job, PCONTROL_JOB_DONE, STACK_BOTTOM);
    10     return (FALSE);
    11   }
     7  ASSERT (host == (Host *) job[0].host, "invalid host");
     8  ASSERT (job == (Job *) host[0].job, "invalid job");
    129
    13   if (!GetJobOutput ("stderr", (Host *) job[0].host, &job[0].stderr, job[0].stderr_size)) {
     10  success = TRUE;
     11  success &= GetJobOutput ("stdout", host, &job[0].stdout, job[0].stdout_size);
     12  success &= GetJobOutput ("stderr", host, &job[0].stderr, job[0].stderr_size);
     13
     14  if (!success) {
     15    // XXX some kind of error?
     16    // XXX try again later?
     17    PutHost (host, PCONTROL_HOST_BUSY, STACK_BOTTOM);
    1418    PutJob (job, PCONTROL_JOB_DONE, STACK_BOTTOM);
    1519    return (FALSE);
     
    1721
    1822  /* job's state is either EXIT or CRASH (verify?) */
    19   host = UnlinkJobAndHost (job);
     23  // unlink host & job
     24  job[0].host = NULL;
     25  host[0].job = NULL;
    2026  PutHost (host, PCONTROL_HOST_DONE, STACK_BOTTOM);
    2127  PutJob (job, job[0].state, STACK_BOTTOM);
Note: See TracChangeset for help on using the changeset viewer.