libs/els/driver-async/src/jobNode.cxx
// In some ways this is the most important member of this class.  It *must* be called
// at some point in the processing of this node's job, (preferable at the *end* of
// that job ;-) ) so that it knows when to fire off its children.  No children are
// executed until this node's job is complete.  If there is no job to perform, except
// a few processes that must go in parallel, simply have the job's callback create the
// child nodes, then call thisFinished().  It's job will be done, and the children will
// be fired off.
In some ways this is the most important member of this class.  It *must* be called
at some point in the processing of this node's job, (preferable at the *end* of
that job ;-) ) so that it knows when to fire off its children.  No children are
executed until this node's job is complete.  If there is no job to perform, except
a few processes that must go in parallel, simply have the job's callback create the
child nodes, then call thisFinished().  It's job will be done, and the children will
be fired off.
In some ways this is the most important member of this class . It * must * be called at some point in the processing of this node ' s job ( preferable at the * end * of that job ; - ) ) so that it knows when to fire off its children . No children are executed until this node ' s job is complete . If there is no job to perform except a few processes that must go in parallel simply have the job ' s callback create the child nodes then call thisFinished () . It ' s job will be done and the children will be fired off .
int jobNode::thisFinished(void)
{
  int retval = -1;
  finishedWithMyJob = 1;
  if ( workingChildren )
    {
      int n = workingChildren->size();
      for ( int i = 0; i < n; i++ )
	{
	  if ( ((jobNode *)(*workingChildren)[i])->doJob(syncStatus) < 0 )
	    {
	      errorStatus = -1;  
	    }
	}
    }
  if ( allDone() )
    if ( reportCompletion() >= 0 )
      retval = 1;
  return retval;
}
int jobNode :: thisFinished ( void ) { int retval = -1 ; finishedWithMyJob = 1 ; if ( workingChildren ) { int n = workingChildren -> size ( ) ; for ( int i = 0 ; i < n ; i ++ ) { if ( ( ( jobNode * ) ( * workingChildren ) [ i ] ) -> doJob ( syncStatus ) < 0 ) { errorStatus = -1 ; } } } if ( allDone ( ) ) if ( reportCompletion ( ) >= 0 ) retval = 1 ; return retval ; }
In some ways this is the most important member of this class.
In some ways this is the most important member of this class .
// OK, our job is done, now see if our job generated any children // for each child, fire them off // if we are in SYNC mode, this will process the children one after another // if we are in ASYNC mode, this will fire off all the childrem at the same time // if child errors, we are in error // at this point we are not sure if we are all done or not, because the // children could be executing asynchronously.  This is why we test to // see here if we are all done, (i.e. all children are finished now) and // we also check for completion in the childFinished callback, because we // may not be done until the last asynchronous child has finished