dbDbLink: debug detect dbPutLink w/o locking

Cross-check ownership when lockset debug tracking is enabled.
This commit is contained in:
Michael Davidsaver
2025-06-16 18:08:16 -07:00
parent 8735a7b17c
commit 333446e0fe
2 changed files with 12 additions and 0 deletions

View File

@@ -443,6 +443,17 @@ static long processTarget(dbCommon *psrc, dbCommon *pdst)
epicsUInt8 pact = psrc->pact;
epicsThreadId self = epicsThreadGetIdSelf();
#ifdef LOCKSET_DEBUG
{
lockSet *ls = dbLockGetRef(psrc->lset);
assert(ls->owner == self);
dbLockDecRef(ls);
ls = dbLockGetRef(pdst->lset);
assert(ls->owner == self);
dbLockDecRef(ls);
}
#endif
psrc->pact = TRUE;
if (psrc->ppn)

View File

@@ -12,6 +12,7 @@
#include "dbLock.h"
#include "epicsMutex.h"
#include "epicsSpin.h"
#include "epicsThread.h"
/* Define to enable additional error checking */
#undef LOCKSET_DEBUG