コード例 #1
0
ファイル: smx_synchro.c プロジェクト: Shurakai/SimGrid
static void SIMIX_synchro_finish(smx_action_t action)
{
  XBT_IN("(%p)",action);
  smx_simcall_t simcall = xbt_fifo_shift(action->simcalls);

  switch (action->state) {

    case SIMIX_SRC_TIMEOUT:
      SMX_EXCEPTION(simcall->issuer, timeout_error, 0, "Synchro's wait timeout");
      break;

    case SIMIX_FAILED:
        simcall->issuer->context->iwannadie = 1;
//      SMX_EXCEPTION(simcall->issuer, host_error, 0, "Host failed");
      break;

    default:
      THROW_IMPOSSIBLE;
      break;
  }

  SIMIX_synchro_stop_waiting(simcall->issuer, simcall);
  simcall->issuer->waiting_action = NULL;
  SIMIX_synchro_destroy(action);
  SIMIX_simcall_answer(simcall);
  XBT_OUT();
}
コード例 #2
0
void SIMIX_synchro_finish(smx_activity_t synchro)
{
  XBT_IN("(%p)",synchro);
  smx_simcall_t simcall = synchro->simcalls.front();
  synchro->simcalls.pop_front();

  switch (synchro->state) {

    case SIMIX_SRC_TIMEOUT:
      SMX_EXCEPTION(simcall->issuer, timeout_error, 0, "Synchro's wait timeout");
      break;

    case SIMIX_FAILED:
        simcall->issuer->context->iwannadie = 1;
//      SMX_EXCEPTION(simcall->issuer, host_error, 0, "Host failed");
      break;

    default:
      THROW_IMPOSSIBLE;
      break;
  }

  SIMIX_synchro_stop_waiting(simcall->issuer, simcall);
  simcall->issuer->waiting_synchro = nullptr;
  delete synchro;
  SIMIX_simcall_answer(simcall);
  XBT_OUT();
}