diff --git a/src/rec/calcoutRecord.c b/src/rec/calcoutRecord.c index 7a379a334..204ffc13b 100644 --- a/src/rec/calcoutRecord.c +++ b/src/rec/calcoutRecord.c @@ -31,40 +31,39 @@ * ----------------- * .01 08-29-96 nda Created from calcoutRecord.c for EPICS R3.13 * .02 09-13-96 nda Original release for EPICS R3.13beta3 + * .03 11-05-98 nda fixed a tricky bug found by Tim Mooney + * concerning callbacks to check link status * * */ -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include -#include -#include -#include +#include +#include +#include -#include "dbDefs.h" -#include "epicsPrint.h" -#include "alarm.h" -#include "dbAccess.h" -#include "dbEvent.h" -#include "dbScan.h" -#include "errMdef.h" -#include "recSup.h" -#include "special.h" -#include "callback.h" -#include "taskwd.h" -#include "postfix.h" +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include #define GEN_SIZE_OFFSET -#include "calcoutRecord.h" +#include #undef GEN_SIZE_OFFSET -#include "menuIvoa.h" +#include /* Create RSET - Record Support Entry Table*/ #define report NULL @@ -712,10 +711,17 @@ static void checkLinksCallback(pcallback) callbackGetUser(pcalc, pcallback); prpvt = (struct rpvtStruct *)pcalc->rpvt; - dbScanLock((struct dbCommon *)pcalc); - prpvt->wd_id_1_LOCK = 0; - checkLinks(pcalc); - dbScanUnlock((struct dbCommon *)pcalc); + if (!interruptAccept) { + /* Can't call dbScanLock yet. Schedule another CALLBACK */ + prpvt->wd_id_1_LOCK = 1; /* make sure */ + wdStart(prpvt->wd_id_1, 30, (FUNCPTR)callbackRequest, + (int)(&prpvt->checkLinkCb)); + } else { + dbScanLock((struct dbCommon *)pcalc); + prpvt->wd_id_1_LOCK = 0; + checkLinks(pcalc); + dbScanUnlock((struct dbCommon *)pcalc); + } }