void scanShutdown(void) { int i; if (scanCtl == ctlExit) return; scanCtl = ctlExit; interruptAccept = FALSE; for (i = 0; i < nPeriodic; i++) { papPeriodic[i]->scanCtl = ctlExit; epicsEventSignal(papPeriodic[i]->loopEvent); epicsEventWait(startStopEvent); } scanOnce((dbCommon *)&exitOnce); epicsEventWait(startStopEvent); deletePeriodic(); ioscanDestroy(); epicsRingPointerDelete(onceQ); epicsEventDestroy(startStopEvent); epicsEventDestroy(onceSem); onceSem = startStopEvent = NULL; free(periodicTaskId); papPeriodic = NULL; periodicTaskId = NULL; }
void callbackCleanup(void) { int i; for (i = 0; i < NUM_CALLBACK_PRIORITIES; i++) { cbQueueSet *mySet = &callbackQueue[i]; assert(epicsAtomicGetIntT(&mySet->threadsRunning)==0); epicsEventDestroy(mySet->semWakeUp); epicsRingPointerDelete(mySet->queue); } epicsTimerQueueRelease(timerQueue); callbackIsInit = 0; memset(callbackQueue, 0, sizeof(callbackQueue)); }