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/check.c

    r8296 r8424  
    11# include "pcontrol.h"
    2 
    3 char jobstate[7][32]  = {"PENDING", "BUSY", "HUNG", "DONE", "KILL", "EXIT", "CRASH"};
    4 char hoststate[5][32] = {"IDLE",    "BUSY", "DOWN", "DONE", "OFF"};
    52
    63int check (int argc, char **argv) {
     
    1815  if (!strcasecmp (argv[1], "JOB")) {
    1916    JobID = atoi (argv[2]);
     17
     18    SetCheckPoint ();  // ensure the JOB is on one of the stacks
    2019    job = PullJobByID (JobID, &StackID);
    2120    if (job == NULL) {
    2221      gprint (GP_LOG, "job not found\n");
     22      ClearCheckPoint ();
    2323      return (FALSE);
    2424    }
    25     gprint (GP_LOG, "STATUS %s\n", jobstate[StackID]);
     25    gprint (GP_LOG, "STATUS %s\n", GetJobStackName(StackID));
    2626    gprint (GP_LOG, "EXITST %d\n", job[0].exit_status);
    2727    gprint (GP_LOG, "STDOUT %d\n", job[0].stdout_size);
    2828    gprint (GP_LOG, "STDERR %d\n", job[0].stderr_size);
    2929    PutJob (job, StackID, STACK_BOTTOM);
     30    ClearCheckPoint ();
    3031    return (TRUE);
    3132  }
     
    3334  if (!strcasecmp (argv[1], "HOST")) {
    3435    HostID = atoi (argv[2]);
     36
     37    SetCheckPoint ();  // ensure the HOST is on one of the stacks
    3538    host = PullHostByID (HostID, &StackID);
    3639    if (host == NULL) {
    3740      gprint (GP_LOG, "host not found\n");
     41      ClearCheckPoint ();
    3842      return (FALSE);
    3943    }
    40     gprint (GP_LOG, "host %s\n", hoststate[StackID]);
     44    gprint (GP_LOG, "host %s\n", GetHostStackName(StackID));
    4145    PutHost (host, StackID, STACK_BOTTOM);
     46    ClearCheckPoint ();
    4247    return (TRUE);
    4348  }
     
    4651  return (FALSE);
    4752}
    48 
    49 XXX how do I handle objects which are in flight??
Note: See TracChangeset for help on using the changeset viewer.