Exemple #1
0
void releaseDispatch(DISPATCH_PTR dispatch)
{
  if (dispatch) {
    
    if (dispatch->refCount == 0) {
      LOG2("\nWARNING: Releasing an unreserved dispatch %s (%d)\n",
	  dispatch->msg->msgData->name, dispatch->locId);
    } else {
      dispatch->refCount--;
    }
    
    if (dispatch->refCount <= 0) {
#ifndef NMP_IPC
      HandleKillAfterAttendingNodes(dispatch);
      if ((dispatch->status == HandledDispatch) && !dispatch->treeNode) {
	dispatchFree(dispatch);
#else
      if (dispatch->status == HandledDispatch) {
	dispatchFree(dispatch);
#endif
      }
    }
  }
}

/******************************************************************************
 *
 * FUNCTION: void dispatchStats
 *
 * DESCRIPTION: Print stats about the utilization of dispatches in central
 *
 * INPUTS: 
 *
 * OUTPUTS: 
 *
 *****************************************************************************/

#if 0
/* No longer used */
void dispatchStats ()
{
  int32 i, num=0;
  DISPATCH_PTR dispatch;
  
  for (i=0; i<GET_S_GLOBAL(dispatchTable)->currentSize; i++) {
    dispatch = (DISPATCH_PTR)idTableItem(i, GET_S_GLOBAL(dispatchTable));
    if (dispatch->status != UnallocatedDispatch) {
      printf("%d. %s\n", ++num, dispatch->msg->msgData->name);
    }
  }
}
Exemple #2
0
void processHandledMessage(DISPATCH_PTR dispatch)
{
  dispatchUpdateAndDisplay(HandledDispatch, dispatch);
  resourceRemoveAttending(dispatch);
  
  tapAfterHandled(dispatch);
  if (dispatch->msg && !ONE_WAY_MSG(dispatch->msg)) {
    switch (dispatch->msg_class) {
    case SuccessClass: 
#ifndef NMP_IPC
      tapWhenSuccess(dispatch); 
      tapAfterSuccess(dispatch); 
#endif
      break;
#ifndef NMP_IPC
    case FailureClass: 
      tapWhenFailure(dispatch);
      tapAfterFailure(dispatch);
      break;
#endif
    default:
      /* X_IPC_MOD_ERROR("Unhandled default"); */
      X_IPC_MOD_WARNING1("unhandled default in  processHandledMessage %d\n",
		    dispatch->msg_class);
      break;
    }
  }
  
  resourceProcessPending(dispatch);
#ifndef NMP_IPC
  CompletionConstraints(dispatch);
  HandleKillAfterAttendingNodes(dispatch);
#endif
  if (!dispatch->msg || ONE_WAY_MSG(dispatch->msg))
    dispatchFree(dispatch);
  
  /* 14-May-91: fedor: exception class messages that are byPassed or retry
     should not be dispatch freed arbitrarly - may need to declare the first
     message handled and then resend the same dispatch through recvMessage */
}