diff --git a/src/db/db_access.c b/src/db/db_access.c index d9d0bc8..5d2d926 100644 --- a/src/db/db_access.c +++ b/src/db/db_access.c @@ -37,6 +37,7 @@ #include "db_access.h" #undef db_accessHFORdb_accessC #define epicsExportSharedSymbols +#include "dbLock.h" #include "dbNotify.h" #include "dbAccessDefs.h" #include "dbEvent.h" @@ -182,6 +183,8 @@ int epicsShareAPI db_get_field_and_count( * in the dbAccess.c dbGet() and getOptions() routines. */ + dbScanLock( paddr->precord ); + switch(buffer_type) { case(oldDBR_STRING): status = dbGetField(paddr, DBR_STRING, pbuffer, &zero, nRequest, pfl); @@ -820,8 +823,12 @@ int epicsShareAPI db_get_field_and_count( } break; default: - return -1; + status = -1; + break; } + + dbScanUnlock( paddr->precord ); + if (status) return -1; return 0; }