Experimental Physics and
| |||||||||||||||||
|
I guess we should have documented this better, which if present is used by the new epicsExit() subsystem in R3.14.7. I added the following code to the APS vxWorks BSPs: /* This gives a rebootHook for EPICS before netLib has been shut down, * and also runs the C++ static desctructors of all loaded modules */ VOIDFUNCPTR _func_sysRebootHook = NULL; static int sysRebootHook(int startType) { if (_func_sysRebootHook) (*_func_sysRebootHook)(); cplusDtors(0); return OK; } int sysAtReboot(VOIDFUNCPTR closedown) { if (closedown && _func_sysRebootHook) return ERROR; _func_sysRebootHook = closedown; return OK; } The vxWorks reboot hooks are executed in the order in which they are registered, whereas it would make a lot more sense if they were executed in reverse order. WRS have shown no inclination to fix this bug (which they even document as a bug IIRC), so I now register a reboot hook routine *before* netLibInit() gets run (from the same routine where I configure the network memory pool): rebootHookAdd(sysRebootHook); By registering a reboot hook routine there, libCom's epicsExit() subsystem can call the routines registered with epicsAtExit() before the vxWorks network gets shut down by its hook routine, and as a result CA circuits close down nicely whenever you do a Control-X reboot. It also calls all the C++ static destructors as well. It is not strictly necessary to add the above code to your BSPs; EPICS will work exactly as it always has without this, with the exception of the warning message that Kay reported. Having it there does make vxWorks IOCs slightly better network citizens though, and may reduce some delays when the rebooted IOC comes up. - Andrew -- Dear God, I didn't think orange went with purple until I saw the sunset you made last night. That was really cool. - Caro
| ||||||||||||||||
ANJ, 02 Sep 2010 |
·
Home
·
News
·
About
·
Base
·
Modules
·
Extensions
·
Distributions
·
Download
·
· Search · EPICS V4 · IRMIS · Talk · Bugs · Documents · Links · Licensing · |