Skip to content

Commit

Permalink
Merge 584082a into 85d1982
Browse files Browse the repository at this point in the history
  • Loading branch information
mdavidsaver committed Apr 24, 2020
2 parents 85d1982 + 584082a commit 39cdc8e
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 2 deletions.
13 changes: 11 additions & 2 deletions modules/database/src/ioc/misc/iocInit.c
Expand Up @@ -710,20 +710,27 @@ int iocShutdown(void)
{
if (iocState == iocVoid) return 0;

initHookAnnounce(initHookAtShutdown);

iterateRecords(doCloseLinks, NULL);
initHookAnnounce(initHookAfterCloseLinks);

if (iocBuildMode == buildIsolated) {
/* stop and "join" threads */
scanStop();
initHookAnnounce(initHookAfterStopScan);
callbackStop();
}
else
initHookAnnounce(initHookAfterStopCallback);
} else {
dbStopServers();
}

dbCaShutdown(); /* must be before dbFreeRecord and dbChannelExit */
initHookAnnounce(initHookAfterStopLinks);

if (iocBuildMode == buildIsolated) {
/* free resources */
initHookAnnounce(initHookBeforeFree);
scanCleanup();
callbackCleanup();

Expand All @@ -738,6 +745,8 @@ int iocShutdown(void)

iocState = iocVoid;
iocBuildMode = buildServers;

initHookAnnounce(initHookAfterShutdown);
return 0;
}

Expand Down
8 changes: 8 additions & 0 deletions modules/libcom/src/iocsh/initHooks.h
Expand Up @@ -47,6 +47,14 @@ typedef enum {
initHookAfterDatabasePaused,
initHookAfterIocPaused, /* End of iocPause command */

initHookAtShutdown, /* Start of iocShutdown commands */
initHookAfterCloseLinks,
initHookAfterStopScan, /* conditional */
initHookAfterStopCallback, /* conditional */
initHookAfterStopLinks,
initHookBeforeFree, /* conditional */
initHookAfterShutdown, /* End of iocShutdown commands */

/* 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.
Expand Down

0 comments on commit 39cdc8e

Please sign in to comment.