Minimize work done in readLocked() routine

Move post-I/O work back to the read_xx routines.
This commit is contained in:
Andrew Johnson
2017-04-26 15:59:03 -05:00
parent c13a4f24ce
commit bbd94928bb
4 changed files with 72 additions and 48 deletions

View File

@@ -51,6 +51,7 @@ static long init_record(stringinRecord *prec)
{
if (recGblInitConstantLink(&prec->inp, DBF_STRING, prec->val))
prec->udf = FALSE;
return 0;
}
@@ -59,13 +60,12 @@ static long readLocked(struct link *pinp, void *dummy)
stringinRecord *prec = (stringinRecord *) pinp->precord;
long status = dbGetLink(pinp, DBR_STRING, prec->val, 0, 0);
if (!status) {
if (!dbLinkIsConstant(pinp))
prec->udf = FALSE;
if (dbLinkIsConstant(&prec->tsel) &&
prec->tse == epicsTimeEventDeviceTime)
dbGetTimeStamp(pinp, &prec->time);
}
if (status) return status;
if (dbLinkIsConstant(&prec->tsel) &&
prec->tse == epicsTimeEventDeviceTime)
dbGetTimeStamp(pinp, &prec->time);
return status;
}
@@ -76,5 +76,8 @@ static long read_stringin(stringinRecord *prec)
if (status == S_db_noLSET)
status = readLocked(&prec->inp, NULL);
if (!status && !dbLinkIsConstant(&prec->inp))
prec->udf = FALSE;
return status;
}