iocInit: move dbCaShutdown earlier

Switch dbCaShutdown from an exit hook to
be called from iocShutdown.  Place it
after callback shutdown.
This commit is contained in:
Michael Davidsaver
2015-07-21 19:08:07 -04:00
parent 1411522a11
commit 504665bf09
2 changed files with 4 additions and 8 deletions

View File

@@ -223,19 +223,12 @@ void dbCaShutdown(void)
}
}
static void dbCaExit(void *arg)
{
dbCaShutdown();
}
void dbCaLinkInitIsolated(void)
{
if (!workListLock)
workListLock = epicsMutexMustCreate();
if (!workListEvent) {
if (!workListEvent)
workListEvent = epicsEventMustCreate(epicsEventEmpty);
epicsAtExit(dbCaExit, NULL);
}
dbCaCtl = ctlExit;
}

View File

@@ -682,6 +682,9 @@ int iocShutdown(void)
/* stop and "join" threads */
scanStop();
callbackStop();
}
dbCaShutdown();
if (iocBuildMode==buildIsolated) {
/* free resources */
scanCleanup();
callbackCleanup();