instrument PE locking
fix missing unlock in index_pred (if predicate had been indexed while we were waiting).
This commit is contained in:
parent
5b6014175e
commit
e031026a62
41
C/absmi.c
41
C/absmi.c
@ -1094,7 +1094,7 @@ Yap_absmi(int inp)
|
|||||||
/* HEY, leave indexing block alone!! */
|
/* HEY, leave indexing block alone!! */
|
||||||
/* check if we are the ones using this code */
|
/* check if we are the ones using this code */
|
||||||
#if defined(YAPOR) || defined(THREADS)
|
#if defined(YAPOR) || defined(THREADS)
|
||||||
LOCK(ap->PELock);
|
PELOCK(1, ap);
|
||||||
PP = ap;
|
PP = ap;
|
||||||
DEC_CLREF_COUNT(cl);
|
DEC_CLREF_COUNT(cl);
|
||||||
/* clear the entry from the trail */
|
/* clear the entry from the trail */
|
||||||
@ -1395,7 +1395,7 @@ Yap_absmi(int inp)
|
|||||||
/* HEY, leave indexing block alone!! */
|
/* HEY, leave indexing block alone!! */
|
||||||
/* check if we are the ones using this code */
|
/* check if we are the ones using this code */
|
||||||
#if defined(YAPOR) || defined(THREADS)
|
#if defined(YAPOR) || defined(THREADS)
|
||||||
LOCK(ap->PELock);
|
PELOCK(2, ap);
|
||||||
PP = ap;
|
PP = ap;
|
||||||
DEC_CLREF_COUNT(cl);
|
DEC_CLREF_COUNT(cl);
|
||||||
/* clear the entry from the trail */
|
/* clear the entry from the trail */
|
||||||
@ -1492,7 +1492,7 @@ Yap_absmi(int inp)
|
|||||||
GONext();
|
GONext();
|
||||||
}
|
}
|
||||||
PP = PREG->u.p.p;
|
PP = PREG->u.p.p;
|
||||||
LOCK(PP->PELock);
|
PELOCK(3, PP);
|
||||||
#endif
|
#endif
|
||||||
PREG = NEXTOP(PREG, p);
|
PREG = NEXTOP(PREG, p);
|
||||||
GONext();
|
GONext();
|
||||||
@ -1676,7 +1676,7 @@ Yap_absmi(int inp)
|
|||||||
|
|
||||||
/* spy_or_trymark */
|
/* spy_or_trymark */
|
||||||
BOp(spy_or_trymark, Otapl);
|
BOp(spy_or_trymark, Otapl);
|
||||||
LOCK(((PredEntry *)(PREG->u.Otapl.p))->PELock);
|
PELOCK(5, ((PredEntry *)(PREG->u.Otapl.p)));
|
||||||
PREG = (yamop *)(&(((PredEntry *)(PREG->u.Otapl.p))->OpcodeOfPred));
|
PREG = (yamop *)(&(((PredEntry *)(PREG->u.Otapl.p))->OpcodeOfPred));
|
||||||
UNLOCK(((PredEntry *)(PREG->u.Otapl.p))->PELock);
|
UNLOCK(((PredEntry *)(PREG->u.Otapl.p))->PELock);
|
||||||
goto dospy;
|
goto dospy;
|
||||||
@ -1691,7 +1691,7 @@ Yap_absmi(int inp)
|
|||||||
CUT_wait_leftmost();
|
CUT_wait_leftmost();
|
||||||
#endif /* YAPOR */
|
#endif /* YAPOR */
|
||||||
if (PREG->u.Otapl.p->PredFlags & LogUpdatePredFlag) {
|
if (PREG->u.Otapl.p->PredFlags & LogUpdatePredFlag) {
|
||||||
LOCK(PREG->u.Otapl.p->PELock);
|
PELOCK(6,PREG->u.Otapl.p);
|
||||||
PP = PREG->u.Otapl.p;
|
PP = PREG->u.Otapl.p;
|
||||||
}
|
}
|
||||||
if (PREG->u.Otapl.p->CodeOfPred != PREG) {
|
if (PREG->u.Otapl.p->CodeOfPred != PREG) {
|
||||||
@ -1774,7 +1774,7 @@ Yap_absmi(int inp)
|
|||||||
CUT_wait_leftmost();
|
CUT_wait_leftmost();
|
||||||
#endif /* YAPOR */
|
#endif /* YAPOR */
|
||||||
/* need to make the DB stable until I get the new clause */
|
/* need to make the DB stable until I get the new clause */
|
||||||
LOCK(PREG->u.Otapl.p->PELock);
|
PELOCK(7,PREG->u.Otapl.p);
|
||||||
CACHE_Y(B);
|
CACHE_Y(B);
|
||||||
PREG = PREG->u.Otapl.d;
|
PREG = PREG->u.Otapl.d;
|
||||||
LOCK(DynamicLock(PREG));
|
LOCK(DynamicLock(PREG));
|
||||||
@ -2069,7 +2069,7 @@ Yap_absmi(int inp)
|
|||||||
int erase;
|
int erase;
|
||||||
PredEntry *ap = cl->ClPred;
|
PredEntry *ap = cl->ClPred;
|
||||||
|
|
||||||
LOCK(ap->PELock);
|
PELOCK(8,ap);
|
||||||
DEC_CLREF_COUNT(cl);
|
DEC_CLREF_COUNT(cl);
|
||||||
erase = (cl->ClFlags & ErasedMask) && !(cl->ClRefCount);
|
erase = (cl->ClFlags & ErasedMask) && !(cl->ClRefCount);
|
||||||
if (erase) {
|
if (erase) {
|
||||||
@ -2093,7 +2093,7 @@ Yap_absmi(int inp)
|
|||||||
int erase;
|
int erase;
|
||||||
PredEntry *ap = cl->ClPred;
|
PredEntry *ap = cl->ClPred;
|
||||||
|
|
||||||
LOCK(ap->PELock);
|
PELOCK(9,ap);
|
||||||
DEC_CLREF_COUNT(cl);
|
DEC_CLREF_COUNT(cl);
|
||||||
erase = (cl->ClFlags & ErasedMask) && !(cl->ClRefCount);
|
erase = (cl->ClFlags & ErasedMask) && !(cl->ClRefCount);
|
||||||
if (erase) {
|
if (erase) {
|
||||||
@ -7813,7 +7813,7 @@ Yap_absmi(int inp)
|
|||||||
#if defined(YAPOR) || defined(THREADS)
|
#if defined(YAPOR) || defined(THREADS)
|
||||||
{
|
{
|
||||||
PredEntry *ap = PredFromDefCode(PREG);
|
PredEntry *ap = PredFromDefCode(PREG);
|
||||||
LOCK(ap->PELock);
|
PELOCK(10,ap);
|
||||||
PP = ap;
|
PP = ap;
|
||||||
if (!ap->cs.p_code.NOfClauses) {
|
if (!ap->cs.p_code.NOfClauses) {
|
||||||
FAIL();
|
FAIL();
|
||||||
@ -7852,10 +7852,13 @@ Yap_absmi(int inp)
|
|||||||
we must take extra care here
|
we must take extra care here
|
||||||
*/
|
*/
|
||||||
if (!PP) {
|
if (!PP) {
|
||||||
LOCK(ap->PELock);
|
PELOCK(11,ap);
|
||||||
}
|
}
|
||||||
if (ap->OpcodeOfPred != INDEX_OPCODE) {
|
if (ap->OpcodeOfPred != INDEX_OPCODE) {
|
||||||
/* someone was here before we were */
|
/* someone was here before we were */
|
||||||
|
if (!PP) {
|
||||||
|
UNLOCKPE(11,ap);
|
||||||
|
}
|
||||||
PREG = ap->CodeOfPred;
|
PREG = ap->CodeOfPred;
|
||||||
/* for profiler */
|
/* for profiler */
|
||||||
save_pc();
|
save_pc();
|
||||||
@ -7909,12 +7912,13 @@ Yap_absmi(int inp)
|
|||||||
}
|
}
|
||||||
#if defined(YAPOR) || defined(THREADS)
|
#if defined(YAPOR) || defined(THREADS)
|
||||||
if (!PP) {
|
if (!PP) {
|
||||||
LOCK(pe->PELock);
|
PELOCK(12,pe);
|
||||||
}
|
}
|
||||||
if (!same_lu_block(PREG_ADDR, PREG)) {
|
if (!same_lu_block(PREG_ADDR, PREG)) {
|
||||||
PREG = *PREG_ADDR;
|
PREG = *PREG_ADDR;
|
||||||
if (!PP)
|
if (!PP) {
|
||||||
UNLOCK(pe->PELock);
|
UNLOCK(pe->PELock);
|
||||||
|
}
|
||||||
JMPNext();
|
JMPNext();
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
@ -7930,9 +7934,10 @@ Yap_absmi(int inp)
|
|||||||
#endif /* SHADOW_S */
|
#endif /* SHADOW_S */
|
||||||
PREG = pt0;
|
PREG = pt0;
|
||||||
#if defined(YAPOR) || defined(THREADS)
|
#if defined(YAPOR) || defined(THREADS)
|
||||||
if (!PP)
|
if (!PP) {
|
||||||
|
UNLOCKPE(12,pe);
|
||||||
|
}
|
||||||
#endif
|
#endif
|
||||||
UNLOCK(pe->PELock);
|
|
||||||
JMPNext();
|
JMPNext();
|
||||||
}
|
}
|
||||||
ENDBOp();
|
ENDBOp();
|
||||||
@ -7949,7 +7954,7 @@ Yap_absmi(int inp)
|
|||||||
}
|
}
|
||||||
#if defined(YAPOR) || defined(THREADS)
|
#if defined(YAPOR) || defined(THREADS)
|
||||||
if (PP == NULL) {
|
if (PP == NULL) {
|
||||||
LOCK(pe->PELock);
|
PELOCK(13,pe);
|
||||||
}
|
}
|
||||||
if (!same_lu_block(PREG_ADDR, PREG)) {
|
if (!same_lu_block(PREG_ADDR, PREG)) {
|
||||||
PREG = *PREG_ADDR;
|
PREG = *PREG_ADDR;
|
||||||
@ -8048,7 +8053,7 @@ Yap_absmi(int inp)
|
|||||||
{
|
{
|
||||||
PredEntry *pe = PredFromDefCode(PREG);
|
PredEntry *pe = PredFromDefCode(PREG);
|
||||||
BEGD(d0);
|
BEGD(d0);
|
||||||
LOCK(pe->PELock);
|
PELOCK(14,pe);
|
||||||
if (!(pe->PredFlags & IndexedPredFlag) &&
|
if (!(pe->PredFlags & IndexedPredFlag) &&
|
||||||
pe->cs.p_code.NOfClauses > 1) {
|
pe->cs.p_code.NOfClauses > 1) {
|
||||||
/* update ASP before calling IPred */
|
/* update ASP before calling IPred */
|
||||||
@ -8446,7 +8451,7 @@ Yap_absmi(int inp)
|
|||||||
#if defined(YAPOR) || defined(THREADS)
|
#if defined(YAPOR) || defined(THREADS)
|
||||||
if (!PP) {
|
if (!PP) {
|
||||||
PP = PREG->u.OtaLl.d->ClPred;
|
PP = PREG->u.OtaLl.d->ClPred;
|
||||||
LOCK(PP->PELock);
|
PELOCK(15,PP);
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
timestamp = IntegerOfTerm(((CELL *)(B_YREG+1))[PREG->u.OtaLl.s]);
|
timestamp = IntegerOfTerm(((CELL *)(B_YREG+1))[PREG->u.OtaLl.s]);
|
||||||
@ -8485,7 +8490,7 @@ Yap_absmi(int inp)
|
|||||||
/* fprintf(stderr,"- %p/%p %d %d %p\n",PREG,ap,timestamp,ap->TimeStampOfPred,PREG->u.OtILl.d->ClCode);*/
|
/* fprintf(stderr,"- %p/%p %d %d %p\n",PREG,ap,timestamp,ap->TimeStampOfPred,PREG->u.OtILl.d->ClCode);*/
|
||||||
#if defined(YAPOR) || defined(THREADS)
|
#if defined(YAPOR) || defined(THREADS)
|
||||||
if (!PP) {
|
if (!PP) {
|
||||||
LOCK(ap->PELock);
|
PELOCK(16,ap);
|
||||||
PP = ap;
|
PP = ap;
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
16
C/cdmgr.c
16
C/cdmgr.c
@ -2112,7 +2112,7 @@ addclause(Term t, yamop *cp, int mode, Term mod, Term *t4ref)
|
|||||||
p = RepPredProp(PredPropByFunc(f, mod));
|
p = RepPredProp(PredPropByFunc(f, mod));
|
||||||
}
|
}
|
||||||
Yap_PutValue(AtomAbol, TermNil);
|
Yap_PutValue(AtomAbol, TermNil);
|
||||||
LOCK(p->PELock);
|
PELOCK(20,p);
|
||||||
pflags = p->PredFlags;
|
pflags = p->PredFlags;
|
||||||
/* we are redefining a prolog module predicate */
|
/* we are redefining a prolog module predicate */
|
||||||
if ((pflags & (UserCPredFlag|CArgsPredFlag|NumberDBPredFlag|AtomDBPredFlag|TestPredFlag|AsmPredFlag|CPredFlag|BinaryPredFlag)) ||
|
if ((pflags & (UserCPredFlag|CArgsPredFlag|NumberDBPredFlag|AtomDBPredFlag|TestPredFlag|AsmPredFlag|CPredFlag|BinaryPredFlag)) ||
|
||||||
@ -2731,7 +2731,7 @@ p_purge_clauses(void)
|
|||||||
pred = RepPredProp(PredPropByFunc(fun, mod));
|
pred = RepPredProp(PredPropByFunc(fun, mod));
|
||||||
} else
|
} else
|
||||||
return (FALSE);
|
return (FALSE);
|
||||||
LOCK(pred->PELock);
|
PELOCK(21,pred);
|
||||||
if (pred->PredFlags & StandardPredFlag) {
|
if (pred->PredFlags & StandardPredFlag) {
|
||||||
UNLOCK(pred->PELock);
|
UNLOCK(pred->PELock);
|
||||||
Yap_Error(PERMISSION_ERROR_MODIFY_STATIC_PROCEDURE, t, "assert/1");
|
Yap_Error(PERMISSION_ERROR_MODIFY_STATIC_PROCEDURE, t, "assert/1");
|
||||||
@ -2774,7 +2774,7 @@ p_setspy(void)
|
|||||||
} else {
|
} else {
|
||||||
return (FALSE);
|
return (FALSE);
|
||||||
}
|
}
|
||||||
LOCK(pred->PELock);
|
PELOCK(22,pred);
|
||||||
restart_spy:
|
restart_spy:
|
||||||
if (pred->PredFlags & (CPredFlag | SafePredFlag)) {
|
if (pred->PredFlags & (CPredFlag | SafePredFlag)) {
|
||||||
UNLOCK(pred->PELock);
|
UNLOCK(pred->PELock);
|
||||||
@ -2829,7 +2829,7 @@ p_rmspy(void)
|
|||||||
pred = RepPredProp(Yap_PredPropByFunctorNonThreadLocal(fun, mod));
|
pred = RepPredProp(Yap_PredPropByFunctorNonThreadLocal(fun, mod));
|
||||||
} else
|
} else
|
||||||
return FALSE;
|
return FALSE;
|
||||||
LOCK(pred->PELock);
|
PELOCK(23,pred);
|
||||||
if (!(pred->PredFlags & SpiedPredFlag)) {
|
if (!(pred->PredFlags & SpiedPredFlag)) {
|
||||||
UNLOCK(pred->PELock);
|
UNLOCK(pred->PELock);
|
||||||
return FALSE;
|
return FALSE;
|
||||||
@ -2897,7 +2897,7 @@ p_number_of_clauses(void)
|
|||||||
}
|
}
|
||||||
if (EndOfPAEntr(pe))
|
if (EndOfPAEntr(pe))
|
||||||
return FALSE;
|
return FALSE;
|
||||||
LOCK(RepPredProp(pe)->PELock);
|
PELOCK(24,RepPredProp(pe));
|
||||||
ncl = RepPredProp(pe)->cs.p_code.NOfClauses;
|
ncl = RepPredProp(pe)->cs.p_code.NOfClauses;
|
||||||
UNLOCK(RepPredProp(pe)->PELock);
|
UNLOCK(RepPredProp(pe)->PELock);
|
||||||
return (Yap_unify_constant(ARG3, MkIntegerTerm(ncl)));
|
return (Yap_unify_constant(ARG3, MkIntegerTerm(ncl)));
|
||||||
@ -2912,7 +2912,7 @@ p_in_use(void)
|
|||||||
pe = get_pred(Deref(ARG1), Deref(ARG2), "$in_use");
|
pe = get_pred(Deref(ARG1), Deref(ARG2), "$in_use");
|
||||||
if (EndOfPAEntr(pe))
|
if (EndOfPAEntr(pe))
|
||||||
return FALSE;
|
return FALSE;
|
||||||
LOCK(pe->PELock);
|
PELOCK(25,pe);
|
||||||
out = static_in_use(pe,TRUE);
|
out = static_in_use(pe,TRUE);
|
||||||
UNLOCK(pe->PELock);
|
UNLOCK(pe->PELock);
|
||||||
return(out);
|
return(out);
|
||||||
@ -2944,7 +2944,7 @@ p_new_multifile(void)
|
|||||||
pe = RepPredProp(PredPropByAtom(at, mod));
|
pe = RepPredProp(PredPropByAtom(at, mod));
|
||||||
else
|
else
|
||||||
pe = RepPredProp(PredPropByFunc(Yap_MkFunctor(at, arity),mod));
|
pe = RepPredProp(PredPropByFunc(Yap_MkFunctor(at, arity),mod));
|
||||||
LOCK(pe->PELock);
|
PELOCK(26,pe);
|
||||||
pe->PredFlags |= MultiFileFlag;
|
pe->PredFlags |= MultiFileFlag;
|
||||||
if (pe->ModuleOfPred == PROLOG_MODULE)
|
if (pe->ModuleOfPred == PROLOG_MODULE)
|
||||||
pe->ModuleOfPred = TermProlog;
|
pe->ModuleOfPred = TermProlog;
|
||||||
@ -2966,7 +2966,7 @@ p_is_multifile(void)
|
|||||||
pe = get_pred(Deref(ARG1), Deref(ARG2), "$is_multifile");
|
pe = get_pred(Deref(ARG1), Deref(ARG2), "$is_multifile");
|
||||||
if (EndOfPAEntr(pe))
|
if (EndOfPAEntr(pe))
|
||||||
return FALSE;
|
return FALSE;
|
||||||
LOCK(pe->PELock);
|
PELOCK(27,pe);
|
||||||
out = (pe->PredFlags & MultiFileFlag);
|
out = (pe->PredFlags & MultiFileFlag);
|
||||||
UNLOCK(pe->PELock);
|
UNLOCK(pe->PELock);
|
||||||
return(out);
|
return(out);
|
||||||
|
28
C/compiler.c
28
C/compiler.c
@ -758,7 +758,7 @@ c_arg(Int argno, Term t, unsigned int arity, unsigned int level, compiler_struct
|
|||||||
pop_code(level, cglobs);
|
pop_code(level, cglobs);
|
||||||
}
|
}
|
||||||
} else if (IsRefTerm(t)) {
|
} else if (IsRefTerm(t)) {
|
||||||
LOCK(cglobs->cint.CurrentPred->PELock);
|
PELOCK(40,cglobs->cint.CurrentPred);
|
||||||
if (!(cglobs->cint.CurrentPred->PredFlags & (DynamicPredFlag|LogUpdatePredFlag))) {
|
if (!(cglobs->cint.CurrentPred->PredFlags & (DynamicPredFlag|LogUpdatePredFlag))) {
|
||||||
UNLOCK(cglobs->cint.CurrentPred->PELock);
|
UNLOCK(cglobs->cint.CurrentPred->PELock);
|
||||||
FAIL("can not compile data base reference",TYPE_ERROR_CALLABLE,t);
|
FAIL("can not compile data base reference",TYPE_ERROR_CALLABLE,t);
|
||||||
@ -1466,7 +1466,7 @@ c_goal(Term Goal, Term mod, compiler_struct *cglobs)
|
|||||||
if (cglobs->onlast) {
|
if (cglobs->onlast) {
|
||||||
Yap_emit(deallocate_op, Zero, Zero, &cglobs->cint);
|
Yap_emit(deallocate_op, Zero, Zero, &cglobs->cint);
|
||||||
#ifdef TABLING
|
#ifdef TABLING
|
||||||
LOCK(cglobs->cint.CurrentPred->PELock);
|
PELOCK(41,cglobs->cint.CurrentPred);
|
||||||
if (is_tabled(cglobs->cint.CurrentPred))
|
if (is_tabled(cglobs->cint.CurrentPred))
|
||||||
Yap_emit(table_new_answer_op, Zero, cglobs->cint.CurrentPred->ArityOfPE, &cglobs->cint);
|
Yap_emit(table_new_answer_op, Zero, cglobs->cint.CurrentPred->ArityOfPE, &cglobs->cint);
|
||||||
else
|
else
|
||||||
@ -1487,7 +1487,7 @@ c_goal(Term Goal, Term mod, compiler_struct *cglobs)
|
|||||||
/* never a problem here with a -> b, !, c ; d */
|
/* never a problem here with a -> b, !, c ; d */
|
||||||
Yap_emit(deallocate_op, Zero, Zero, &cglobs->cint);
|
Yap_emit(deallocate_op, Zero, Zero, &cglobs->cint);
|
||||||
#ifdef TABLING
|
#ifdef TABLING
|
||||||
LOCK(cglobs->cint.CurrentPred->PELock);
|
PELOCK(42,cglobs->cint.CurrentPred);
|
||||||
if (is_tabled(cglobs->cint.CurrentPred)) {
|
if (is_tabled(cglobs->cint.CurrentPred)) {
|
||||||
Yap_emit_3ops(cut_op, Zero, Zero, Zero, &cglobs->cint);
|
Yap_emit_3ops(cut_op, Zero, Zero, Zero, &cglobs->cint);
|
||||||
Yap_emit(table_new_answer_op, Zero, cglobs->cint.CurrentPred->ArityOfPE, &cglobs->cint);
|
Yap_emit(table_new_answer_op, Zero, cglobs->cint.CurrentPred->ArityOfPE, &cglobs->cint);
|
||||||
@ -1535,7 +1535,7 @@ c_goal(Term Goal, Term mod, compiler_struct *cglobs)
|
|||||||
Yap_emit(label_op, l2, Zero, &cglobs->cint);
|
Yap_emit(label_op, l2, Zero, &cglobs->cint);
|
||||||
if (cglobs->onlast) {
|
if (cglobs->onlast) {
|
||||||
#ifdef TABLING
|
#ifdef TABLING
|
||||||
LOCK(cglobs->cint.CurrentPred->PELock);
|
PELOCK(43,cglobs->cint.CurrentPred);
|
||||||
if (is_tabled(cglobs->cint.CurrentPred))
|
if (is_tabled(cglobs->cint.CurrentPred))
|
||||||
Yap_emit(table_new_answer_op, Zero, cglobs->cint.CurrentPred->ArityOfPE, &cglobs->cint);
|
Yap_emit(table_new_answer_op, Zero, cglobs->cint.CurrentPred->ArityOfPE, &cglobs->cint);
|
||||||
else
|
else
|
||||||
@ -1781,7 +1781,7 @@ c_goal(Term Goal, Term mod, compiler_struct *cglobs)
|
|||||||
if (cglobs->onlast) {
|
if (cglobs->onlast) {
|
||||||
Yap_emit(deallocate_op, Zero, Zero, &cglobs->cint);
|
Yap_emit(deallocate_op, Zero, Zero, &cglobs->cint);
|
||||||
#ifdef TABLING
|
#ifdef TABLING
|
||||||
LOCK(cglobs->cint.CurrentPred->PELock);
|
PELOCK(44,cglobs->cint.CurrentPred);
|
||||||
if (is_tabled(cglobs->cint.CurrentPred))
|
if (is_tabled(cglobs->cint.CurrentPred))
|
||||||
Yap_emit(table_new_answer_op, Zero, cglobs->cint.CurrentPred->ArityOfPE, &cglobs->cint);
|
Yap_emit(table_new_answer_op, Zero, cglobs->cint.CurrentPred->ArityOfPE, &cglobs->cint);
|
||||||
else
|
else
|
||||||
@ -1811,7 +1811,7 @@ c_goal(Term Goal, Term mod, compiler_struct *cglobs)
|
|||||||
if (cglobs->onlast) {
|
if (cglobs->onlast) {
|
||||||
Yap_emit(deallocate_op, Zero, Zero, &cglobs->cint);
|
Yap_emit(deallocate_op, Zero, Zero, &cglobs->cint);
|
||||||
#ifdef TABLING
|
#ifdef TABLING
|
||||||
LOCK(cglobs->cint.CurrentPred->PELock);
|
PELOCK(45,cglobs->cint.CurrentPred);
|
||||||
if (is_tabled(cglobs->cint.CurrentPred))
|
if (is_tabled(cglobs->cint.CurrentPred))
|
||||||
Yap_emit(table_new_answer_op, Zero, cglobs->cint.CurrentPred->ArityOfPE, &cglobs->cint);
|
Yap_emit(table_new_answer_op, Zero, cglobs->cint.CurrentPred->ArityOfPE, &cglobs->cint);
|
||||||
else
|
else
|
||||||
@ -1843,7 +1843,7 @@ c_goal(Term Goal, Term mod, compiler_struct *cglobs)
|
|||||||
if (cglobs->onlast) {
|
if (cglobs->onlast) {
|
||||||
Yap_emit(deallocate_op, Zero, Zero, &cglobs->cint);
|
Yap_emit(deallocate_op, Zero, Zero, &cglobs->cint);
|
||||||
#ifdef TABLING
|
#ifdef TABLING
|
||||||
LOCK(cglobs->cint.CurrentPred->PELock);
|
PELOCK(46,cglobs->cint.CurrentPred);
|
||||||
if (is_tabled(cglobs->cint.CurrentPred))
|
if (is_tabled(cglobs->cint.CurrentPred))
|
||||||
Yap_emit(table_new_answer_op, Zero, cglobs->cint.CurrentPred->ArityOfPE, &cglobs->cint);
|
Yap_emit(table_new_answer_op, Zero, cglobs->cint.CurrentPred->ArityOfPE, &cglobs->cint);
|
||||||
else
|
else
|
||||||
@ -1926,7 +1926,7 @@ c_goal(Term Goal, Term mod, compiler_struct *cglobs)
|
|||||||
if (cglobs->onlast) {
|
if (cglobs->onlast) {
|
||||||
Yap_emit(deallocate_op, Zero, Zero, &cglobs->cint);
|
Yap_emit(deallocate_op, Zero, Zero, &cglobs->cint);
|
||||||
#ifdef TABLING
|
#ifdef TABLING
|
||||||
LOCK(cglobs->cint.CurrentPred->PELock);
|
PELOCK(47,cglobs->cint.CurrentPred);
|
||||||
if (is_tabled(cglobs->cint.CurrentPred))
|
if (is_tabled(cglobs->cint.CurrentPred))
|
||||||
Yap_emit(table_new_answer_op, Zero, cglobs->cint.CurrentPred->ArityOfPE, &cglobs->cint);
|
Yap_emit(table_new_answer_op, Zero, cglobs->cint.CurrentPred->ArityOfPE, &cglobs->cint);
|
||||||
else
|
else
|
||||||
@ -1961,7 +1961,7 @@ c_goal(Term Goal, Term mod, compiler_struct *cglobs)
|
|||||||
if (cglobs->onlast) {
|
if (cglobs->onlast) {
|
||||||
Yap_emit(deallocate_op, Zero, Zero, &cglobs->cint);
|
Yap_emit(deallocate_op, Zero, Zero, &cglobs->cint);
|
||||||
#ifdef TABLING
|
#ifdef TABLING
|
||||||
LOCK(cglobs->cint.CurrentPred->PELock);
|
PELOCK(48,cglobs->cint.CurrentPred);
|
||||||
if (is_tabled(cglobs->cint.CurrentPred))
|
if (is_tabled(cglobs->cint.CurrentPred))
|
||||||
Yap_emit(table_new_answer_op, Zero, cglobs->cint.CurrentPred->ArityOfPE, &cglobs->cint);
|
Yap_emit(table_new_answer_op, Zero, cglobs->cint.CurrentPred->ArityOfPE, &cglobs->cint);
|
||||||
else
|
else
|
||||||
@ -1993,7 +1993,7 @@ c_goal(Term Goal, Term mod, compiler_struct *cglobs)
|
|||||||
Yap_emit(deallocate_op, Zero, Zero, &cglobs->cint);
|
Yap_emit(deallocate_op, Zero, Zero, &cglobs->cint);
|
||||||
cglobs->or_found = TRUE;
|
cglobs->or_found = TRUE;
|
||||||
#ifdef TABLING
|
#ifdef TABLING
|
||||||
LOCK(cglobs->cint.CurrentPred->PELock);
|
PELOCK(49,cglobs->cint.CurrentPred);
|
||||||
if (is_tabled(cglobs->cint.CurrentPred))
|
if (is_tabled(cglobs->cint.CurrentPred))
|
||||||
Yap_emit(table_new_answer_op, Zero, cglobs->cint.CurrentPred->ArityOfPE, &cglobs->cint);
|
Yap_emit(table_new_answer_op, Zero, cglobs->cint.CurrentPred->ArityOfPE, &cglobs->cint);
|
||||||
else
|
else
|
||||||
@ -2008,7 +2008,7 @@ c_goal(Term Goal, Term mod, compiler_struct *cglobs)
|
|||||||
if (cglobs->onlast) {
|
if (cglobs->onlast) {
|
||||||
Yap_emit(deallocate_op, Zero, Zero, &cglobs->cint);
|
Yap_emit(deallocate_op, Zero, Zero, &cglobs->cint);
|
||||||
#ifdef TABLING
|
#ifdef TABLING
|
||||||
LOCK(cglobs->cint.CurrentPred->PELock);
|
PELOCK(50,cglobs->cint.CurrentPred);
|
||||||
if (is_tabled(cglobs->cint.CurrentPred)) {
|
if (is_tabled(cglobs->cint.CurrentPred)) {
|
||||||
cglobs->needs_env = TRUE;
|
cglobs->needs_env = TRUE;
|
||||||
Yap_emit_3ops(call_op, (CELL) p0, Zero, Zero, &cglobs->cint);
|
Yap_emit_3ops(call_op, (CELL) p0, Zero, Zero, &cglobs->cint);
|
||||||
@ -2810,7 +2810,7 @@ c_layout(compiler_struct *cglobs)
|
|||||||
cglobs->cint.cpc->op = nop_op;
|
cglobs->cint.cpc->op = nop_op;
|
||||||
} else {
|
} else {
|
||||||
#ifdef TABLING
|
#ifdef TABLING
|
||||||
LOCK(cglobs->cint.CurrentPred->PELock);
|
PELOCK(51,cglobs->cint.CurrentPred);
|
||||||
if (is_tabled(cglobs->cint.CurrentPred))
|
if (is_tabled(cglobs->cint.CurrentPred))
|
||||||
cglobs->cint.cpc->op = nop_op;
|
cglobs->cint.cpc->op = nop_op;
|
||||||
else
|
else
|
||||||
@ -3460,7 +3460,7 @@ Yap_cclause(volatile Term inp_clause, Int NOfArgs, Term mod, volatile Term src)
|
|||||||
cglobs.cint.CurrentPred = RepPredProp(PredPropByFunc(FunctorOfTerm(head),mod));
|
cglobs.cint.CurrentPred = RepPredProp(PredPropByFunc(FunctorOfTerm(head),mod));
|
||||||
}
|
}
|
||||||
/* insert extra instructions to count calls */
|
/* insert extra instructions to count calls */
|
||||||
LOCK(cglobs.cint.CurrentPred->PELock);
|
PELOCK(52,cglobs.cint.CurrentPred);
|
||||||
if ((cglobs.cint.CurrentPred->PredFlags & ProfiledPredFlag) ||
|
if ((cglobs.cint.CurrentPred->PredFlags & ProfiledPredFlag) ||
|
||||||
(PROFILING && (cglobs.cint.CurrentPred->cs.p_code.FirstClause == NIL))) {
|
(PROFILING && (cglobs.cint.CurrentPred->cs.p_code.FirstClause == NIL))) {
|
||||||
profiling = TRUE;
|
profiling = TRUE;
|
||||||
@ -3482,7 +3482,7 @@ Yap_cclause(volatile Term inp_clause, Int NOfArgs, Term mod, volatile Term src)
|
|||||||
|
|
||||||
if (cglobs.is_a_fact && !cglobs.vtable) {
|
if (cglobs.is_a_fact && !cglobs.vtable) {
|
||||||
#ifdef TABLING
|
#ifdef TABLING
|
||||||
LOCK(cglobs.cint.CurrentPred->PELock);
|
PELOCK(53,cglobs.cint.CurrentPred);
|
||||||
if (is_tabled(cglobs.cint.CurrentPred))
|
if (is_tabled(cglobs.cint.CurrentPred))
|
||||||
Yap_emit(table_new_answer_op, Zero, cglobs.cint.CurrentPred->ArityOfPE, &cglobs.cint);
|
Yap_emit(table_new_answer_op, Zero, cglobs.cint.CurrentPred->ArityOfPE, &cglobs.cint);
|
||||||
else
|
else
|
||||||
|
22
C/dbase.c
22
C/dbase.c
@ -1895,7 +1895,7 @@ record_lu_at(int position, LogUpdClause *ocl, Term t)
|
|||||||
PredEntry *pe;
|
PredEntry *pe;
|
||||||
|
|
||||||
pe = ocl->ClPred;
|
pe = ocl->ClPred;
|
||||||
LOCK(pe->PELock);
|
PELOCK(62,pe);
|
||||||
if ((cl = new_lu_db_entry(t,pe)) == NULL) {
|
if ((cl = new_lu_db_entry(t,pe)) == NULL) {
|
||||||
UNLOCK(pe->PELock);
|
UNLOCK(pe->PELock);
|
||||||
return NULL;
|
return NULL;
|
||||||
@ -1951,7 +1951,7 @@ p_rcda(void)
|
|||||||
if (pe) {
|
if (pe) {
|
||||||
LogUpdClause *cl;
|
LogUpdClause *cl;
|
||||||
|
|
||||||
LOCK(pe->PELock);
|
PELOCK(61,pe);
|
||||||
cl = record_lu(pe, Deref(ARG2), MkFirst);
|
cl = record_lu(pe, Deref(ARG2), MkFirst);
|
||||||
if (cl != NULL) {
|
if (cl != NULL) {
|
||||||
TRAIL_CLREF(cl);
|
TRAIL_CLREF(cl);
|
||||||
@ -2061,7 +2061,7 @@ p_rcdz(void)
|
|||||||
if (pe) {
|
if (pe) {
|
||||||
LogUpdClause *cl;
|
LogUpdClause *cl;
|
||||||
|
|
||||||
LOCK(pe->PELock);
|
PELOCK(62,pe);
|
||||||
cl = record_lu(pe, t2, MkLast);
|
cl = record_lu(pe, t2, MkLast);
|
||||||
if (cl != NULL) {
|
if (cl != NULL) {
|
||||||
TRAIL_CLREF(cl);
|
TRAIL_CLREF(cl);
|
||||||
@ -2367,7 +2367,7 @@ copy_attachments(CELL *ts)
|
|||||||
static Term
|
static Term
|
||||||
GetDBLUKey(PredEntry *ap)
|
GetDBLUKey(PredEntry *ap)
|
||||||
{
|
{
|
||||||
LOCK(ap->PELock);
|
PELOCK(63,ap);
|
||||||
if (ap->PredFlags & NumberDBPredFlag) {
|
if (ap->PredFlags & NumberDBPredFlag) {
|
||||||
Int id = ap->src.IndxId;
|
Int id = ap->src.IndxId;
|
||||||
UNLOCK(ap->PELock);
|
UNLOCK(ap->PELock);
|
||||||
@ -2867,7 +2867,7 @@ FetchDBPropFromKey(Term twork, int flag, int new, char *error_mssg)
|
|||||||
pp = RepPredProp(Yap_GetPredPropHavingLock(At, arity, dbmod));
|
pp = RepPredProp(Yap_GetPredPropHavingLock(At, arity, dbmod));
|
||||||
|
|
||||||
if (!EndOfPAEntr(pp)) {
|
if (!EndOfPAEntr(pp)) {
|
||||||
LOCK(pp->PELock);
|
PELOCK(64,pp);
|
||||||
if(pp->PredFlags & LogUpdatePredFlag)
|
if(pp->PredFlags & LogUpdatePredFlag)
|
||||||
UPDATE_MODE = UPDATE_MODE_LOGICAL;
|
UPDATE_MODE = UPDATE_MODE_LOGICAL;
|
||||||
UNLOCK(pp->PELock);
|
UNLOCK(pp->PELock);
|
||||||
@ -2909,7 +2909,7 @@ lu_nth_recorded(PredEntry *pe, Int Count)
|
|||||||
if (cl == NULL)
|
if (cl == NULL)
|
||||||
return FALSE;
|
return FALSE;
|
||||||
#if defined(YAPOR) || defined(THREADS)
|
#if defined(YAPOR) || defined(THREADS)
|
||||||
LOCK(pe->PELock);
|
PELOCK(65,pe);
|
||||||
TRAIL_CLREF(cl); /* So that fail will erase it */
|
TRAIL_CLREF(cl); /* So that fail will erase it */
|
||||||
INC_CLREF_COUNT(cl);
|
INC_CLREF_COUNT(cl);
|
||||||
UNLOCK(pe->PELock);
|
UNLOCK(pe->PELock);
|
||||||
@ -2991,7 +2991,7 @@ p_nth_instance(void)
|
|||||||
Term pred_module;
|
Term pred_module;
|
||||||
|
|
||||||
pe = cl->ClPred;
|
pe = cl->ClPred;
|
||||||
LOCK(pe->PELock);
|
PELOCK(66,pe);
|
||||||
if (cl->ClFlags & ErasedMask) {
|
if (cl->ClFlags & ErasedMask) {
|
||||||
UNLOCK(pe->PELock);
|
UNLOCK(pe->PELock);
|
||||||
return FALSE;
|
return FALSE;
|
||||||
@ -3436,7 +3436,7 @@ lu_recorded(PredEntry *pe) {
|
|||||||
op_numbers opc = Yap_op_from_opcode(P->opc);
|
op_numbers opc = Yap_op_from_opcode(P->opc);
|
||||||
|
|
||||||
#if defined(YAPOR) || defined(THREADS)
|
#if defined(YAPOR) || defined(THREADS)
|
||||||
LOCK(pe->PELock);
|
PELOCK(66,pe);
|
||||||
PP = pe;
|
PP = pe;
|
||||||
#endif
|
#endif
|
||||||
if (opc == _procceed) {
|
if (opc == _procceed) {
|
||||||
@ -4349,7 +4349,7 @@ EraseEntry(DBRef entryref)
|
|||||||
if (entryref->Flags & LogUpdMask &&
|
if (entryref->Flags & LogUpdMask &&
|
||||||
!(entryref->Flags & DBClMask)) {
|
!(entryref->Flags & DBClMask)) {
|
||||||
LogUpdClause *luclause = (LogUpdClause *)entryref;
|
LogUpdClause *luclause = (LogUpdClause *)entryref;
|
||||||
LOCK(luclause->ClPred->PELock);
|
PELOCK(67,luclause->ClPred);
|
||||||
EraseLogUpdCl(luclause);
|
EraseLogUpdCl(luclause);
|
||||||
UNLOCK(luclause->ClPred->PELock);
|
UNLOCK(luclause->ClPred->PELock);
|
||||||
return;
|
return;
|
||||||
@ -4611,7 +4611,7 @@ p_instance(void)
|
|||||||
LogUpdClause *cl = (LogUpdClause *)dbr;
|
LogUpdClause *cl = (LogUpdClause *)dbr;
|
||||||
PredEntry *ap = cl->ClPred;
|
PredEntry *ap = cl->ClPred;
|
||||||
|
|
||||||
LOCK(ap->PELock);
|
PELOCK(68,ap);
|
||||||
if (cl->ClFlags & ErasedMask) {
|
if (cl->ClFlags & ErasedMask) {
|
||||||
UNLOCK(ap->PELock);
|
UNLOCK(ap->PELock);
|
||||||
return FALSE;
|
return FALSE;
|
||||||
@ -5413,7 +5413,7 @@ p_install_thread_local(void)
|
|||||||
} else {
|
} else {
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
LOCK(pe->PELock);
|
PELOCK(69,pe);
|
||||||
if (pe->PredFlags & (UserCPredFlag|HiddenPredFlag|CArgsPredFlag|SyncPredFlag|TestPredFlag|AsmPredFlag|StandardPredFlag|CPredFlag|SafePredFlag|IndexedPredFlag|BinaryPredFlag) ||
|
if (pe->PredFlags & (UserCPredFlag|HiddenPredFlag|CArgsPredFlag|SyncPredFlag|TestPredFlag|AsmPredFlag|StandardPredFlag|CPredFlag|SafePredFlag|IndexedPredFlag|BinaryPredFlag) ||
|
||||||
pe->cs.p_code.NOfClauses) {
|
pe->cs.p_code.NOfClauses) {
|
||||||
return FALSE;
|
return FALSE;
|
||||||
|
@ -67,7 +67,7 @@ legal_env (CELL *ep)
|
|||||||
return (FALSE);
|
return (FALSE);
|
||||||
ps = *((CELL *) (Addr (cp) - CellSize));
|
ps = *((CELL *) (Addr (cp) - CellSize));
|
||||||
pe = (PredEntry *) (ps - sizeof (OPREG) - sizeof (Prop));
|
pe = (PredEntry *) (ps - sizeof (OPREG) - sizeof (Prop));
|
||||||
LOCK(pe->PELock);
|
PELOCK(70,pe);
|
||||||
if (!ONHEAP (pe) || Unsigned (pe) & 3 || pe->KindOfPE & 0xff00) {
|
if (!ONHEAP (pe) || Unsigned (pe) & 3 || pe->KindOfPE & 0xff00) {
|
||||||
UNLOCK(pe->PELock);
|
UNLOCK(pe->PELock);
|
||||||
return (FALSE);
|
return (FALSE);
|
||||||
@ -100,7 +100,7 @@ DumpActiveGoals (void)
|
|||||||
pe = EnvPreg((yamop *)cp);
|
pe = EnvPreg((yamop *)cp);
|
||||||
if (!ONHEAP (pe) || Unsigned (pe) & (sizeof(CELL)-1))
|
if (!ONHEAP (pe) || Unsigned (pe) & (sizeof(CELL)-1))
|
||||||
break;
|
break;
|
||||||
LOCK(pe->PELock);
|
PELOCK(71,pe);
|
||||||
if (pe->KindOfPE & 0xff00) {
|
if (pe->KindOfPE & 0xff00) {
|
||||||
UNLOCK(pe->PELock);
|
UNLOCK(pe->PELock);
|
||||||
break;
|
break;
|
||||||
@ -142,7 +142,7 @@ DumpActiveGoals (void)
|
|||||||
if (!ONLOCAL (b_ptr) || b_ptr->cp_b == NULL)
|
if (!ONLOCAL (b_ptr) || b_ptr->cp_b == NULL)
|
||||||
break;
|
break;
|
||||||
pe = Yap_PredForChoicePt(b_ptr);
|
pe = Yap_PredForChoicePt(b_ptr);
|
||||||
LOCK(pe->PELock);
|
PELOCK(72,pe);
|
||||||
{
|
{
|
||||||
Functor f;
|
Functor f;
|
||||||
Term mod = PROLOG_MODULE;
|
Term mod = PROLOG_MODULE;
|
||||||
|
6
C/exec.c
6
C/exec.c
@ -795,7 +795,7 @@ p_execute_nonstop(void)
|
|||||||
#if defined(YAPOR) || defined(THREADS)
|
#if defined(YAPOR) || defined(THREADS)
|
||||||
if (RepPredProp(pe)->PredFlags & LogUpdatePredFlag) {
|
if (RepPredProp(pe)->PredFlags & LogUpdatePredFlag) {
|
||||||
PP = RepPredProp(pe);
|
PP = RepPredProp(pe);
|
||||||
LOCK(PP->PELock);
|
PELOCK(80,PP);
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
return CallPredicate(RepPredProp(pe), B, RepPredProp(pe)->cs.p_code.TrueCodeOfPred);
|
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) {
|
if (pe == NIL) {
|
||||||
return(CallMetaCall(mod));
|
return(CallMetaCall(mod));
|
||||||
}
|
}
|
||||||
LOCK(ppe->PELock);
|
PELOCK(81,ppe);
|
||||||
if (IsAtomTerm(t)) {
|
if (IsAtomTerm(t)) {
|
||||||
CodeAdr = RepPredProp (pe)->CodeOfPred;
|
CodeAdr = RepPredProp (pe)->CodeOfPred;
|
||||||
UNLOCK(ppe->PELock);
|
UNLOCK(ppe->PELock);
|
||||||
@ -1271,7 +1271,7 @@ Yap_RunTopGoal(Term t)
|
|||||||
/* we must always start the emulator with Prolog code */
|
/* we must always start the emulator with Prolog code */
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
LOCK(ppe->PELock);
|
PELOCK(82,ppe);
|
||||||
CodeAdr = ppe->CodeOfPred;
|
CodeAdr = ppe->CodeOfPred;
|
||||||
UNLOCK(ppe->PELock);
|
UNLOCK(ppe->PELock);
|
||||||
#if !USE_SYSTEM_MALLOC
|
#if !USE_SYSTEM_MALLOC
|
||||||
|
@ -2546,7 +2546,7 @@ sweep_trail(choiceptr gc_B, tr_fr_ptr old_TR)
|
|||||||
*/
|
*/
|
||||||
PredEntry *ap = indx->ClPred;
|
PredEntry *ap = indx->ClPred;
|
||||||
if (ap != PP)
|
if (ap != PP)
|
||||||
LOCK(ap->PELock);
|
PELOCK(85,ap);
|
||||||
#endif
|
#endif
|
||||||
DEC_CLREF_COUNT(indx);
|
DEC_CLREF_COUNT(indx);
|
||||||
indx->ClFlags &= ~InUseMask;
|
indx->ClFlags &= ~InUseMask;
|
||||||
@ -2570,7 +2570,7 @@ sweep_trail(choiceptr gc_B, tr_fr_ptr old_TR)
|
|||||||
|
|
||||||
#if defined(YAPOR) || defined(THREADS)
|
#if defined(YAPOR) || defined(THREADS)
|
||||||
if (ap != PP)
|
if (ap != PP)
|
||||||
LOCK(ap->PELock);
|
PELOCK(86,ap);
|
||||||
#endif
|
#endif
|
||||||
DEC_CLREF_COUNT(cl);
|
DEC_CLREF_COUNT(cl);
|
||||||
cl->ClFlags &= ~InUseMask;
|
cl->ClFlags &= ~InUseMask;
|
||||||
|
1
C/init.c
1
C/init.c
@ -1159,7 +1159,6 @@ InitFirstWorkerThreadHandle(void)
|
|||||||
ThreadHandle.default_yaam_regs =
|
ThreadHandle.default_yaam_regs =
|
||||||
&Yap_standard_regs;
|
&Yap_standard_regs;
|
||||||
ThreadHandle.pthread_handle = pthread_self();
|
ThreadHandle.pthread_handle = pthread_self();
|
||||||
ThreadHandle.pthread_handle = pthread_self();
|
|
||||||
pthread_mutex_init(&FOREIGN_ThreadHandle(0).tlock, NULL);
|
pthread_mutex_init(&FOREIGN_ThreadHandle(0).tlock, NULL);
|
||||||
pthread_mutex_init(&FOREIGN_ThreadHandle(0).tlock_status, NULL);
|
pthread_mutex_init(&FOREIGN_ThreadHandle(0).tlock_status, NULL);
|
||||||
ThreadHandle.tdetach = MkAtomTerm(AtomFalse);
|
ThreadHandle.tdetach = MkAtomTerm(AtomFalse);
|
||||||
|
@ -607,7 +607,7 @@ FindAtom(codeToFind, arity)
|
|||||||
pp = RepPredProp(pp->NextOfPE);
|
pp = RepPredProp(pp->NextOfPE);
|
||||||
if (pp != NIL) {
|
if (pp != NIL) {
|
||||||
CODEADDR *out;
|
CODEADDR *out;
|
||||||
LOCK(pp->PELock);
|
PELOCK(90,pp);
|
||||||
out = &(pp->CodeOfPred)
|
out = &(pp->CodeOfPred)
|
||||||
*arityp = pp->ArityOfPE;
|
*arityp = pp->ArityOfPE;
|
||||||
UNLOCK(pp->PELock);
|
UNLOCK(pp->PELock);
|
||||||
@ -632,7 +632,7 @@ FindAtom(codeToFind, arity)
|
|||||||
pp = RepPredProp(pp->NextOfPE);
|
pp = RepPredProp(pp->NextOfPE);
|
||||||
if (pp != NIL) {
|
if (pp != NIL) {
|
||||||
CODEADDR *out;
|
CODEADDR *out;
|
||||||
LOCK(pp->PELock);
|
PELOCK(91,pp);
|
||||||
out = &(pp->CodeOfPred)
|
out = &(pp->CodeOfPred)
|
||||||
*arityp = pp->ArityOfPE;
|
*arityp = pp->ArityOfPE;
|
||||||
UNLOCK(pp->PELock);
|
UNLOCK(pp->PELock);
|
||||||
@ -3124,7 +3124,7 @@ p_flags(void)
|
|||||||
return (FALSE);
|
return (FALSE);
|
||||||
if (EndOfPAEntr(pe))
|
if (EndOfPAEntr(pe))
|
||||||
return (FALSE);
|
return (FALSE);
|
||||||
LOCK(pe->PELock);
|
PELOCK(92,pe);
|
||||||
if (!Yap_unify_constant(ARG3, MkIntegerTerm(pe->PredFlags))) {
|
if (!Yap_unify_constant(ARG3, MkIntegerTerm(pe->PredFlags))) {
|
||||||
UNLOCK(pe->PELock);
|
UNLOCK(pe->PELock);
|
||||||
return(FALSE);
|
return(FALSE);
|
||||||
|
@ -154,7 +154,7 @@ copy_complex_term(CELL *pt0, CELL *pt0_end, int share, int newattvs, CELL *ptf,
|
|||||||
DBRef entryref = DBRefOfTerm(d0);
|
DBRef entryref = DBRefOfTerm(d0);
|
||||||
if (entryref->Flags & LogUpdMask) {
|
if (entryref->Flags & LogUpdMask) {
|
||||||
LogUpdClause *luclause = (LogUpdClause *)entryref;
|
LogUpdClause *luclause = (LogUpdClause *)entryref;
|
||||||
LOCK(luclause->ClPred->PELock);
|
PELOCK(100,luclause->ClPred);
|
||||||
UNLOCK(luclause->ClPred->PELock);
|
UNLOCK(luclause->ClPred->PELock);
|
||||||
} else {
|
} else {
|
||||||
LOCK(entryref->lock);
|
LOCK(entryref->lock);
|
||||||
|
@ -128,6 +128,9 @@ typedef struct thandle {
|
|||||||
long long int thread_inst_count;
|
long long int thread_inst_count;
|
||||||
int been_here1;
|
int been_here1;
|
||||||
int been_here2;
|
int been_here2;
|
||||||
|
#endif
|
||||||
|
#ifdef DEBUG
|
||||||
|
int been_here;
|
||||||
#endif
|
#endif
|
||||||
pthread_mutex_t tlock;
|
pthread_mutex_t tlock;
|
||||||
pthread_mutex_t tlock_status;
|
pthread_mutex_t tlock_status;
|
||||||
|
10
H/Yatom.h
10
H/Yatom.h
@ -1520,4 +1520,14 @@ PredPropByAtom (Atom at, Term cur_mod)
|
|||||||
return Yap_NewPredPropByAtom (ae, cur_mod);
|
return Yap_NewPredPropByAtom (ae, cur_mod);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#if DEBUG_PELOCKING
|
||||||
|
#define PELOCK(I,Z) \
|
||||||
|
{ LOCK((Z)->PELock); (Z)->StatisticsForPred.NOfEntries=(I),(Z)->StatisticsForPred.NOfHeadSuccesses=pthread_self(); }
|
||||||
|
#define UNLOCKPE(I,Z) \
|
||||||
|
( (Z)->StatisticsForPred.NOfRetries=(I), UNLOCK((Z)->PELock) )
|
||||||
|
#else
|
||||||
|
#define PELOCK(I,Z) LOCK((Z)->PELock)
|
||||||
|
#define UNLOCKPE(I,Z) UNLOCK((Z)->PELock)
|
||||||
|
#endif
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
Reference in New Issue
Block a user