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

    r8296 r8424  
    88  Job *job;
    99
     10  /* if this host has been marked to be turned off, do that and return */
     11  if (host[0].markoff) {
     12    host[0].markoff = FALSE;
     13    StopHost (host);
     14    OffHost (host);
     15    return (TRUE);
     16  }
     17   
    1018  /* search the JOB_PENDING stack for an appropriate job */
    1119  stack = GetJobStack (PCONTROL_JOB_PENDING);
     
    1624    job = (Job *) stack[0].object[i];
    1725    if (job[0].mode != PCONTROL_JOB_NEEDHOST) continue;
    18     if (job[0].hostname == NULL) {
    19       gprint (GP_ERR, "programming error: NEEDHOST hostname missing\n");
    20       exit (2);
    21     }
     26    ASSERT (job[0].hostname != NULL, "NEEDHOST hostname missing");
    2227    if (strcasecmp (job[0].hostname, host[0].hostname)) continue;
    2328
     
    2934    RemoveStackEntry (stack, i);
    3035    UnlockStack (stack);
    31     StartJob (job);
     36    StartJob (job, host);
    3237    return (TRUE);
    3338  }
     
    3742    job = (Job *) stack[0].object[i];
    3843    if (job[0].mode != PCONTROL_JOB_WANTHOST) continue;
    39     if (job[0].hostname == NULL) {
    40       gprint (GP_ERR, "programming error: WANTHOST hostname missing\n");
    41       exit (2);
    42     }
     44    ASSERT (job[0].hostname != NULL, "WANTHOST hostname missing");
    4345    if (strcasecmp (job[0].hostname, host[0].hostname)) continue;
    4446
     
    5052    RemoveStackEntry (stack, i);
    5153    UnlockStack (stack);
    52     StartJob (job);
     54    StartJob (job, host);
    5355    return (TRUE);
    5456  }
     
    6668    RemoveStackEntry (stack, i);
    6769    UnlockStack (stack);
    68     StartJob (job);
    69    return (TRUE);
     70    StartJob (job, host);
     71    return (TRUE);
    7072  }
    7173
     
    7678    job = (Job *) stack[0].object[i];
    7779    if (job[0].mode != PCONTROL_JOB_WANTHOST) continue;
    78     // test the job age and skip if too young
     80    // XXX test the job age and skip if too young
    7981
    8082    /* we have found an appropriate job; link it to the host and send to StartJob */
     
    8587    RemoveStackEntry (stack, i);
    8688    UnlockStack (stack);
    87     StartJob (job);
     89    StartJob (job, host);
    8890   return (TRUE);
    8991  }
Note: See TracChangeset for help on using the changeset viewer.