instrument PE locking

fix missing unlock in index_pred (if predicate had been indexed while we were
waiting).
This commit is contained in:
Vítor Santos Costa
2010-07-25 11:22:16 +01:00
parent 5b6014175e
commit e031026a62
12 changed files with 81 additions and 64 deletions

View File

@@ -67,7 +67,7 @@ legal_env (CELL *ep)
return (FALSE);
ps = *((CELL *) (Addr (cp) - CellSize));
pe = (PredEntry *) (ps - sizeof (OPREG) - sizeof (Prop));
LOCK(pe->PELock);
PELOCK(70,pe);
if (!ONHEAP (pe) || Unsigned (pe) & 3 || pe->KindOfPE & 0xff00) {
UNLOCK(pe->PELock);
return (FALSE);
@@ -100,7 +100,7 @@ DumpActiveGoals (void)
pe = EnvPreg((yamop *)cp);
if (!ONHEAP (pe) || Unsigned (pe) & (sizeof(CELL)-1))
break;
LOCK(pe->PELock);
PELOCK(71,pe);
if (pe->KindOfPE & 0xff00) {
UNLOCK(pe->PELock);
break;
@@ -142,7 +142,7 @@ DumpActiveGoals (void)
if (!ONLOCAL (b_ptr) || b_ptr->cp_b == NULL)
break;
pe = Yap_PredForChoicePt(b_ptr);
LOCK(pe->PELock);
PELOCK(72,pe);
{
Functor f;
Term mod = PROLOG_MODULE;