add debugging code

This commit is contained in:
Vítor Santos Costa 2013-05-01 19:27:00 -05:00
parent 75d607aaec
commit 17cd9ab3c1

View File

@ -2487,7 +2487,6 @@ Yap_absmi(int inp)
PELOCK(9,ap); PELOCK(9,ap);
DEC_CLREF_COUNT(cl); DEC_CLREF_COUNT(cl);
// fprintf(stderr,"%d %p=%lx\n",worker_id, cl, cl->ClRefCount);
erase = (cl->ClFlags & ErasedMask) && !(cl->ClRefCount); erase = (cl->ClFlags & ErasedMask) && !(cl->ClRefCount);
if (erase) { if (erase) {
saveregs(); saveregs();
@ -7824,6 +7823,24 @@ Yap_absmi(int inp)
/* restart index */ /* restart index */
setregs(); setregs();
UNLOCKPE(17,pe); UNLOCKPE(17,pe);
#ifdef DEBUG_LOCK
{ PredEntry *ap = pe;
if (ap->ArityOfPE) {
if ( ap->ModuleOfPred != IDB_MODULE)
printf("L9 %s\n", AtomName(NameOfFunctor(ap->FunctorOfPred)));
else
{
if (ap->PredFlags & NumberDBPredFlag) {
printf("L9 %ld\n", ap->src.IndxId);
} else if (ap->PredFlags & AtomDBPredFlag) {
printf("L9 %s\n", AtomName((Atom)(ap->FunctorOfPred)));
} else {
printf("L9 %s\n", AtomName(NameOfFunctor(ap->FunctorOfPred)));
}
}
}
}
#endif
PREG = pt0; PREG = pt0;
#if defined(YAPOR) || defined(THREADS) #if defined(YAPOR) || defined(THREADS)
if (!PP) { if (!PP) {