tensorflow/core/distributed_runtime/scheduler.cc
// Return true if the update makes the destination of the edge ready to run.
Return true if the update makes the destination of the edge ready to run.
Return true if the update makes the destination of the edge ready to run .
bool UpdatePending(const Edge* edge, std::vector<int>* pending_count) {
  const Node* out = edge->dst();
  if (IsMerge(out)) {
    if (edge->IsControlEdge()) {
      (*pending_count)[out->id()] -= 2;
      return ((*pending_count)[out->id()] == 1);
    } else {
      int count = (*pending_count)[out->id()];
      (*pending_count)[out->id()] |= 0x1;
      return (count == 0);
    }
  } else {
    return (--(*pending_count)[out->id()] == 0);
  }
}
bool UpdatePending ( const Edge * edge , std :: vector < int > * pending_count ) { const Node * out = edge -> dst ( ) ; if ( IsMerge ( out ) ) { if ( edge -> IsControlEdge ( ) ) { ( * pending_count ) [ out -> id ( ) ] -= 2 ; return ( ( * pending_count ) [ out -> id ( ) ] == 1 ) ; } else { int count = ( * pending_count ) [ out -> id ( ) ] ; ( * pending_count ) [ out -> id ( ) ] |= 0x1 ; return ( count == 0 ) ; } } else { return ( -- ( * pending_count ) [ out -> id ( ) ] == 0 ) ; } }
Return true if the update makes the destination of the edge ready to run.
Return true if the update makes the destination of the edge ready to run .
// Return true if we already got at least one input edge //   and a control edge is the enabling one. // If the first input edge is the enabling one, the count goes from //   0 to 1 in this step. Return true iff count was zero.