static pwr_tStatus terminate ( ini_sContext *cp ) { pwr_tStatus sts; qcom_SignalAnd(&sts, &qcom_cQini, 0); qcom_SignalOr(&sts, &qcom_cQini, ini_mEvent_terminate); qcom_Exit(NULL); /* Now sleep for a while */ sleep(3); /* Unlink shared memory and semaphores */ qdb_UnlinkDb(); /* Unlink errlog mwessage queue */ errl_Unlink(); exit(1); }
static pwr_tStatus terminate ( ini_sContext *cp ) { pwr_tStatus sts; qcom_SignalAnd(&sts, &qcom_cQini, 0); qcom_SignalOr(&sts, &qcom_cQini, ini_mEvent_terminate); //qcom_SignalOr(&sts, &qcom_cQini, ini_mEvent_oldPlcStop); //qcom_WaitAnd(&sts, &cp->eventQ, &qcom_cQini, ini_mEvent_oldPlcStopDone, qcom_cTmoEternal); qcom_Exit(NULL); /* Kill programs which until now doesn't handle qcom */ /* for (pp = lst_Succ(NULL, &cp->proc_lh, &pl); pp != NULL; pp = lst_Succ(NULL, pl, &pl)) { if (strncmp("pwr_webmonmh", pp->proc.name, 12) == 0) { kill(pp->proc.pid, SIGKILL); } else if (strncmp("pwr_webmon", pp->proc.name, 10) == 0) { kill(pp->proc.pid, SIGKILL); } } */ /* Now sleep for a while */ sleep(3); /* Unlink shared memory and semaphores */ gdb_UnlinkDb(); qdb_UnlinkDb(); /* Destroy message handler semaphore */ mh_UtilDestroyEvent(); #if defined OS_POISIX /* Unlink errlog mwessage queue */ errl_Unlink(); #endif exit(1); }
static pwr_tStatus terminate() { pwr_tStatus sts; qcom_SignalAnd(&sts, &qcom_cQini, 0); qcom_SignalOr(&sts, &qcom_cQini, ini_mEvent_terminate); // qcom_SignalOr(&sts, &qcom_cQini, ini_mEvent_oldPlcStop); // qcom_WaitAnd(&sts, &cp->eventQ, &qcom_cQini, ini_mEvent_oldPlcStopDone, // qcom_cTmoEternal); qcom_Exit(NULL); /* Kill programs which until now doesn't handle qcom */ /* for (pp = lst_Succ(NULL, &cp->proc_lh, &pl); pp != NULL; pp = lst_Succ(NULL, pl, &pl)) { if (str_StartsWith(pp->proc.name, "pwr_webmonmh")) { kill(pp->proc.pid, SIGKILL); } else if (str_StartsWith(pp->proc.name, "pwr_webmon")) { kill(pp->proc.pid, SIGKILL); } } */ /* Now sleep for a while */ sleep(3); /* Unlink shared memory and semaphores */ gdb_UnlinkDb(); qdb_UnlinkDb(); delete_locks(); /* Destroy message handler semaphore */ mh_UtilDestroyEvent(); /* Unlink errlog message queue */ errl_Unlink(); exit(EXIT_SUCCESS); }