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

@@ -795,7 +795,7 @@ p_execute_nonstop(void)
#if defined(YAPOR) || defined(THREADS)
if (RepPredProp(pe)->PredFlags & LogUpdatePredFlag) {
PP = RepPredProp(pe);
LOCK(PP->PELock);
PELOCK(80,PP);
}
#endif
return CallPredicate(RepPredProp(pe), B, RepPredProp(pe)->cs.p_code.TrueCodeOfPred);
@@ -1119,7 +1119,7 @@ Yap_execute_goal(Term t, int nargs, Term mod)
if (pe == NIL) {
return(CallMetaCall(mod));
}
LOCK(ppe->PELock);
PELOCK(81,ppe);
if (IsAtomTerm(t)) {
CodeAdr = RepPredProp (pe)->CodeOfPred;
UNLOCK(ppe->PELock);
@@ -1271,7 +1271,7 @@ Yap_RunTopGoal(Term t)
/* we must always start the emulator with Prolog code */
return FALSE;
}
LOCK(ppe->PELock);
PELOCK(82,ppe);
CodeAdr = ppe->CodeOfPred;
UNLOCK(ppe->PELock);
#if !USE_SYSTEM_MALLOC