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
+11 -7
View File
@@ -60,14 +60,15 @@ static long init_record(mbbiRecord *prec)
static long readLocked(struct link *pinp, void *dummy)
{
mbbiRecord *prec = (mbbiRecord *) pinp->precord;
long status = dbGetLink(pinp, DBR_LONG, &prec->rval, 0, 0);
if (!dbGetLink(pinp, DBR_LONG, &prec->rval, 0, 0)) {
prec->rval &= prec->mask;
if (dbLinkIsConstant(&prec->tsel) &&
prec->tse == epicsTimeEventDeviceTime)
dbGetTimeStamp(pinp, &prec->time);
}
return 0;
if (status) return status;
if (dbLinkIsConstant(&prec->tsel) &&
prec->tse == epicsTimeEventDeviceTime)
dbGetTimeStamp(pinp, &prec->time);
return status;
}
static long read_mbbi(mbbiRecord *prec)
@@ -77,5 +78,8 @@ static long read_mbbi(mbbiRecord *prec)
if (status == S_db_noLSET)
status = readLocked(&prec->inp, NULL);
if (!status)
prec->rval &= prec->mask;
return status;
}