iocInit: announce "init" hooks during iocShutdown
This commit is contained in:
@@ -48,6 +48,14 @@ typedef enum {
|
||||
initHookAfterDatabasePaused,
|
||||
initHookAfterIocPaused, /* End of iocPause command */
|
||||
|
||||
initHookAtIocShutdown, /* Start of iocShutdown */
|
||||
initHookAfterCaLinkClose,
|
||||
initHookAfterScanShutdown,
|
||||
initHookAfterCallbackShutdown,
|
||||
initHookAfterCaServerStopped,
|
||||
initHookAfterDatabaseStopped,
|
||||
initHookAfterIocShutdown, /* End of iocShutdown */
|
||||
|
||||
/* Deprecated states, provided for backwards compatibility.
|
||||
* These states are announced at the same point they were before,
|
||||
* but will not be repeated if the IOC gets paused and restarted.
|
||||
|
||||
@@ -688,13 +688,20 @@ static void doFreeRecord(dbRecordType *pdbRecordType, dbCommon *precord,
|
||||
int iocShutdown(void)
|
||||
{
|
||||
if (iocState == iocVirgin || iocState == iocStopped) return 0;
|
||||
initHookAnnounce(initHookAtIocShutdown); // TODO: iterate hooks in reverse
|
||||
iterateRecords(doCloseLinks, NULL);
|
||||
initHookAnnounce(initHookAfterCaLinkClose);
|
||||
if (iocBuildMode==buildIsolated) {
|
||||
/* stop and "join" threads */
|
||||
scanStop();
|
||||
initHookAnnounce(initHookAfterScanShutdown);
|
||||
callbackStop();
|
||||
initHookAnnounce(initHookAfterCallbackShutdown);
|
||||
}
|
||||
dbCaShutdown(); /* must be before dbFreeRecord and dbChannelExit */
|
||||
initHookAnnounce(initHookAfterCaServerStopped);
|
||||
/* placeholder, RSRV will eventually stop here */
|
||||
initHookAnnounce(initHookAfterDatabaseStopped);
|
||||
if (iocBuildMode==buildIsolated) {
|
||||
/* free resources */
|
||||
scanCleanup();
|
||||
@@ -708,6 +715,7 @@ int iocShutdown(void)
|
||||
}
|
||||
iocState = iocStopped;
|
||||
iocBuildMode = buildRSRV;
|
||||
initHookAnnounce(initHookAfterIocShutdown);
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user