示例#1
0
void rwdts_appconf_phase_complete(rwdts_appconf_t *ac, enum rwdts_appconf_phase_e phase) {
  switch (phase) {
    case RWDTS_APPCONF_PHASE_REGISTER:
      ac->phase_complete = TRUE;
      if (ac->regn_timer) {
        rwsched_dispatch_source_cancel(ac->apih->tasklet,
                                       ac->regn_timer);
        rwsched_dispatch_release(ac->apih->tasklet,
                                 ac->regn_timer);
        ac->regn_timer = NULL;
      }

      if (ac->group && ac->group->xact) {
        rwdts_xact_unref(ac->group->xact,__PRETTY_FUNCTION__, __LINE__);
        ac->group->xact = NULL;
      }

      if (ac->phase_complete && !ac->reg_pend) {
        ac->cb.config_apply(ac->apih,
                            ac,
                            NULL, /* no xact -> original, committed data */
                            RWDTS_APPCONF_ACTION_INSTALL,
                            ac->cb.ctx,
                            NULL);
      }
      break;
    default:
      RW_ASSERT_MESSAGE(0, "Unknown appconf phase %d !?\n", (int)phase);
      break;
  }
}
示例#2
0
static void deinit_tasklet(rwmsg_perf_task_t *t) {
  t->v->deinit(t);
  
  if (!t->cfg.mainq) {
    rwsched_dispatch_release(t->tasklet, t->rws_q);
  }
  t->rws_q = NULL;

  //if (!perf.bro || t->ep != perf.bro->ep) {
  if (!t->bro) {
    rwmsg_endpoint_halt_flush(t->ep, TRUE);
    t->ep = NULL;
  }

  perf.killed_tasks++;
}
示例#3
0
static void rwdts_appconf_regn_check_timer(void *ctx)
{
  rwdts_appconf_t *ac = (rwdts_appconf_t *)ctx;
  RW_ASSERT_TYPE(ac, rwdts_appconf_t);
  rwdts_api_t* apih = ac->apih;
  RW_ASSERT_TYPE(apih, rwdts_api_t);

  RW_ASSERT_MESSAGE(ac->phase_complete, "Appconf Registration not complete on time");

  rwsched_dispatch_source_cancel(apih->tasklet,
                                 ac->regn_timer);
  rwsched_dispatch_release(apih->tasklet,
                           ac->regn_timer);
  ac->regn_timer = NULL;

  return;
}
示例#4
0
void rwdts_appconf_group_destroy(rwdts_appconf_t *ac) {
  RW_ASSERT_TYPE(ac, rwdts_appconf_t);
  if (ac->cb.xact_init_dtor) {
    ac->cb.xact_init_dtor(ac->cb.ctx);
  }
  if (ac->cb.xact_deinit_dtor) {
    ac->cb.xact_deinit_dtor(NULL);
  }

  if (ac->regn_timer) {
    rwsched_dispatch_source_cancel(ac->apih->tasklet,
                                   ac->regn_timer);
    rwsched_dispatch_release(ac->apih->tasklet,
                             ac->regn_timer);
    ac->regn_timer = NULL;
  }

  memset(&ac->cb, 0, sizeof(ac->cb));
  rwdts_group_destroy(ac->group);
  RW_FREE_TYPE(ac, rwdts_appconf_t);
}