should not use PP for thread private
more lock tracing aids.
This commit is contained in:
parent
431ceadc50
commit
ccb7991a56
54
C/absmi.c
54
C/absmi.c
@ -1502,7 +1502,7 @@ Yap_absmi(int inp)
|
|||||||
/* lock logical updates predicate. */
|
/* lock logical updates predicate. */
|
||||||
Op(unlock_lu, e);
|
Op(unlock_lu, e);
|
||||||
#if defined(YAPOR) || defined(THREADS)
|
#if defined(YAPOR) || defined(THREADS)
|
||||||
UNLOCK(PP->PELock);
|
UNLOCKPE(1,PP);
|
||||||
PP = NULL;
|
PP = NULL;
|
||||||
#endif
|
#endif
|
||||||
PREG = NEXTOP(PREG, e);
|
PREG = NEXTOP(PREG, e);
|
||||||
@ -1523,7 +1523,7 @@ Yap_absmi(int inp)
|
|||||||
/* always add an extra reference */
|
/* always add an extra reference */
|
||||||
INC_CLREF_COUNT(cl);
|
INC_CLREF_COUNT(cl);
|
||||||
TRAIL_CLREF(cl);
|
TRAIL_CLREF(cl);
|
||||||
UNLOCK(ap->PELock);
|
UNLOCKPE(2,ap);
|
||||||
PP = NULL;
|
PP = NULL;
|
||||||
}
|
}
|
||||||
#else
|
#else
|
||||||
@ -1555,7 +1555,7 @@ Yap_absmi(int inp)
|
|||||||
if (Yap_Error_TYPE == OUT_OF_ATTVARS_ERROR) {
|
if (Yap_Error_TYPE == OUT_OF_ATTVARS_ERROR) {
|
||||||
Yap_Error_TYPE = YAP_NO_ERROR;
|
Yap_Error_TYPE = YAP_NO_ERROR;
|
||||||
if (!Yap_growglobal(NULL)) {
|
if (!Yap_growglobal(NULL)) {
|
||||||
UNLOCK(PP->PELock);
|
UNLOCKPE(3,PP);
|
||||||
#if defined(YAPOR) || defined(THREADS)
|
#if defined(YAPOR) || defined(THREADS)
|
||||||
PP = NULL;
|
PP = NULL;
|
||||||
#endif
|
#endif
|
||||||
@ -1565,7 +1565,7 @@ Yap_absmi(int inp)
|
|||||||
} else {
|
} else {
|
||||||
Yap_Error_TYPE = YAP_NO_ERROR;
|
Yap_Error_TYPE = YAP_NO_ERROR;
|
||||||
if (!Yap_gc(3, ENV, CP)) {
|
if (!Yap_gc(3, ENV, CP)) {
|
||||||
UNLOCK(PP->PELock);
|
UNLOCKPE(4,PP);
|
||||||
#if defined(YAPOR) || defined(THREADS)
|
#if defined(YAPOR) || defined(THREADS)
|
||||||
PP = NULL;
|
PP = NULL;
|
||||||
#endif
|
#endif
|
||||||
@ -1576,7 +1576,7 @@ Yap_absmi(int inp)
|
|||||||
}
|
}
|
||||||
if (!Yap_IUnify(ARG2, t)) {
|
if (!Yap_IUnify(ARG2, t)) {
|
||||||
setregs();
|
setregs();
|
||||||
UNLOCK(PP->PELock);
|
UNLOCKPE(5,PP);
|
||||||
#if defined(YAPOR) || defined(THREADS)
|
#if defined(YAPOR) || defined(THREADS)
|
||||||
PP = NULL;
|
PP = NULL;
|
||||||
#endif
|
#endif
|
||||||
@ -1584,7 +1584,7 @@ Yap_absmi(int inp)
|
|||||||
}
|
}
|
||||||
if (!Yap_IUnify(ARG3, MkDBRefTerm((DBRef)cl))) {
|
if (!Yap_IUnify(ARG3, MkDBRefTerm((DBRef)cl))) {
|
||||||
setregs();
|
setregs();
|
||||||
UNLOCK(PP->PELock);
|
UNLOCKPE(6,PP);
|
||||||
#if defined(YAPOR) || defined(THREADS)
|
#if defined(YAPOR) || defined(THREADS)
|
||||||
PP = NULL;
|
PP = NULL;
|
||||||
#endif
|
#endif
|
||||||
@ -1596,7 +1596,7 @@ Yap_absmi(int inp)
|
|||||||
/* always add an extra reference */
|
/* always add an extra reference */
|
||||||
INC_CLREF_COUNT(cl);
|
INC_CLREF_COUNT(cl);
|
||||||
TRAIL_CLREF(cl);
|
TRAIL_CLREF(cl);
|
||||||
UNLOCK(PP->PELock);
|
UNLOCKPE(7,PP);
|
||||||
PP = NULL;
|
PP = NULL;
|
||||||
#else
|
#else
|
||||||
if (!(cl->ClFlags & InUseMask)) {
|
if (!(cl->ClFlags & InUseMask)) {
|
||||||
@ -1626,7 +1626,7 @@ Yap_absmi(int inp)
|
|||||||
saveregs();
|
saveregs();
|
||||||
if (!Yap_IUnify(ARG2, cl->ClSource->Entry)) {
|
if (!Yap_IUnify(ARG2, cl->ClSource->Entry)) {
|
||||||
setregs();
|
setregs();
|
||||||
UNLOCK(PP->PELock);
|
UNLOCKPE(8,PP);
|
||||||
#if defined(YAPOR) || defined(THREADS)
|
#if defined(YAPOR) || defined(THREADS)
|
||||||
PP = NULL;
|
PP = NULL;
|
||||||
#endif
|
#endif
|
||||||
@ -1634,7 +1634,7 @@ Yap_absmi(int inp)
|
|||||||
}
|
}
|
||||||
if (!Yap_IUnify(ARG3, MkDBRefTerm((DBRef)cl))) {
|
if (!Yap_IUnify(ARG3, MkDBRefTerm((DBRef)cl))) {
|
||||||
setregs();
|
setregs();
|
||||||
UNLOCK(PP->PELock);
|
UNLOCKPE(9,PP);
|
||||||
#if defined(YAPOR) || defined(THREADS)
|
#if defined(YAPOR) || defined(THREADS)
|
||||||
PP = NULL;
|
PP = NULL;
|
||||||
#endif
|
#endif
|
||||||
@ -1648,7 +1648,7 @@ Yap_absmi(int inp)
|
|||||||
/* always add an extra reference */
|
/* always add an extra reference */
|
||||||
INC_CLREF_COUNT(cl);
|
INC_CLREF_COUNT(cl);
|
||||||
TRAIL_CLREF(cl);
|
TRAIL_CLREF(cl);
|
||||||
UNLOCK(PP->PELock);
|
UNLOCKPE(10,PP);
|
||||||
PP = NULL;
|
PP = NULL;
|
||||||
#else
|
#else
|
||||||
if (!(cl->ClFlags & InUseMask)) {
|
if (!(cl->ClFlags & InUseMask)) {
|
||||||
@ -1678,7 +1678,7 @@ Yap_absmi(int inp)
|
|||||||
BOp(spy_or_trymark, Otapl);
|
BOp(spy_or_trymark, Otapl);
|
||||||
PELOCK(5, ((PredEntry *)(PREG->u.Otapl.p)));
|
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);
|
UNLOCKPE(11,(PredEntry *)(PREG->u.Otapl.p));
|
||||||
goto dospy;
|
goto dospy;
|
||||||
ENDBOp();
|
ENDBOp();
|
||||||
|
|
||||||
@ -1700,7 +1700,7 @@ Yap_absmi(int inp)
|
|||||||
anything yet */
|
anything yet */
|
||||||
PP = NULL;
|
PP = NULL;
|
||||||
PREG = PREG->u.Otapl.p->CodeOfPred;
|
PREG = PREG->u.Otapl.p->CodeOfPred;
|
||||||
UNLOCK(PREG->u.Otapl.p->PELock);
|
UNLOCKPE(12,PREG->u.Otapl.p);
|
||||||
/* for profiler */
|
/* for profiler */
|
||||||
save_pc();
|
save_pc();
|
||||||
JMPNext();
|
JMPNext();
|
||||||
@ -1714,7 +1714,7 @@ Yap_absmi(int inp)
|
|||||||
*/
|
*/
|
||||||
LOCK(DynamicLock(PREG));
|
LOCK(DynamicLock(PREG));
|
||||||
/* one can now mess around with the predicate */
|
/* one can now mess around with the predicate */
|
||||||
UNLOCK(((PredEntry *)(PREG->u.Otapl.p))->PELock);
|
UNLOCKPE(13,((PredEntry *)(PREG->u.Otapl.p)));
|
||||||
BEGD(d1);
|
BEGD(d1);
|
||||||
d1 = PREG->u.Otapl.s;
|
d1 = PREG->u.Otapl.s;
|
||||||
store_args(d1);
|
store_args(d1);
|
||||||
@ -7881,7 +7881,7 @@ Yap_absmi(int inp)
|
|||||||
#if defined(YAPOR) || defined(THREADS)
|
#if defined(YAPOR) || defined(THREADS)
|
||||||
if (!PP)
|
if (!PP)
|
||||||
#endif
|
#endif
|
||||||
UNLOCK(ap->PELock);
|
UNLOCKPE(14,ap);
|
||||||
|
|
||||||
}
|
}
|
||||||
JMPNext();
|
JMPNext();
|
||||||
@ -7917,7 +7917,7 @@ Yap_absmi(int inp)
|
|||||||
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);
|
UNLOCKPE(15,pe);
|
||||||
}
|
}
|
||||||
JMPNext();
|
JMPNext();
|
||||||
}
|
}
|
||||||
@ -7959,7 +7959,7 @@ Yap_absmi(int inp)
|
|||||||
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);
|
UNLOCKPE(16,pe);
|
||||||
}
|
}
|
||||||
JMPNext();
|
JMPNext();
|
||||||
}
|
}
|
||||||
@ -7968,11 +7968,11 @@ Yap_absmi(int inp)
|
|||||||
pt0 = Yap_ExpandIndex(pe, 0);
|
pt0 = Yap_ExpandIndex(pe, 0);
|
||||||
/* restart index */
|
/* restart index */
|
||||||
setregs();
|
setregs();
|
||||||
UNLOCK(pe->PELock);
|
UNLOCKPE(17,pe);
|
||||||
PREG = pt0;
|
PREG = pt0;
|
||||||
#if defined(YAPOR) || defined(THREADS)
|
#if defined(YAPOR) || defined(THREADS)
|
||||||
if (!PP) {
|
if (!PP) {
|
||||||
UNLOCK(pe->PELock);
|
UNLOCKPE(18,pe);
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
JMPNext();
|
JMPNext();
|
||||||
@ -7990,11 +7990,11 @@ Yap_absmi(int inp)
|
|||||||
#if defined(YAPOR) || defined(THREADS)
|
#if defined(YAPOR) || defined(THREADS)
|
||||||
PP = NULL;
|
PP = NULL;
|
||||||
#endif
|
#endif
|
||||||
UNLOCK(pe->PELock);
|
UNLOCKPE(19,pe);
|
||||||
FAIL();
|
FAIL();
|
||||||
}
|
}
|
||||||
d0 = pe->ArityOfPE;
|
d0 = pe->ArityOfPE;
|
||||||
UNLOCK(pe->PELock);
|
UNLOCKPE(19,pe);
|
||||||
if (d0 == 0) {
|
if (d0 == 0) {
|
||||||
H[1] = MkAtomTerm((Atom)(pe->FunctorOfPred));
|
H[1] = MkAtomTerm((Atom)(pe->FunctorOfPred));
|
||||||
}
|
}
|
||||||
@ -8073,7 +8073,7 @@ Yap_absmi(int inp)
|
|||||||
UNLOCK(pe->StatisticsForPred.lock);
|
UNLOCK(pe->StatisticsForPred.lock);
|
||||||
ReductionsCounter--;
|
ReductionsCounter--;
|
||||||
if (ReductionsCounter == 0 && ReductionsCounterOn) {
|
if (ReductionsCounter == 0 && ReductionsCounterOn) {
|
||||||
UNLOCK(pe->PELock);
|
UNLOCKPE(20,pe);
|
||||||
saveregs();
|
saveregs();
|
||||||
Yap_Error(CALL_COUNTER_UNDERFLOW,TermNil,"");
|
Yap_Error(CALL_COUNTER_UNDERFLOW,TermNil,"");
|
||||||
setregs();
|
setregs();
|
||||||
@ -8081,7 +8081,7 @@ Yap_absmi(int inp)
|
|||||||
}
|
}
|
||||||
PredEntriesCounter--;
|
PredEntriesCounter--;
|
||||||
if (PredEntriesCounter == 0 && PredEntriesCounterOn) {
|
if (PredEntriesCounter == 0 && PredEntriesCounterOn) {
|
||||||
UNLOCK(pe->PELock);
|
UNLOCKPE(21,pe);
|
||||||
saveregs();
|
saveregs();
|
||||||
Yap_Error(PRED_ENTRY_COUNTER_UNDERFLOW,TermNil,"");
|
Yap_Error(PRED_ENTRY_COUNTER_UNDERFLOW,TermNil,"");
|
||||||
setregs();
|
setregs();
|
||||||
@ -8090,7 +8090,7 @@ Yap_absmi(int inp)
|
|||||||
if ((pe->PredFlags & (CountPredFlag|ProfiledPredFlag|SpiedPredFlag)) ==
|
if ((pe->PredFlags & (CountPredFlag|ProfiledPredFlag|SpiedPredFlag)) ==
|
||||||
CountPredFlag) {
|
CountPredFlag) {
|
||||||
PREG = pe->cs.p_code.TrueCodeOfPred;
|
PREG = pe->cs.p_code.TrueCodeOfPred;
|
||||||
UNLOCK(pe->PELock);
|
UNLOCKPE(22,pe);
|
||||||
JMPNext();
|
JMPNext();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -8101,16 +8101,16 @@ Yap_absmi(int inp)
|
|||||||
UNLOCK(pe->StatisticsForPred.lock);
|
UNLOCK(pe->StatisticsForPred.lock);
|
||||||
if (!(pe->PredFlags & SpiedPredFlag)) {
|
if (!(pe->PredFlags & SpiedPredFlag)) {
|
||||||
PREG = pe->cs.p_code.TrueCodeOfPred;
|
PREG = pe->cs.p_code.TrueCodeOfPred;
|
||||||
UNLOCK(pe->PELock);
|
UNLOCKPE(23,pe);
|
||||||
JMPNext();
|
JMPNext();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (!DebugOn) {
|
if (!DebugOn) {
|
||||||
PREG = pe->cs.p_code.TrueCodeOfPred;
|
PREG = pe->cs.p_code.TrueCodeOfPred;
|
||||||
UNLOCK(pe->PELock);
|
UNLOCKPE(24,pe);
|
||||||
JMPNext();
|
JMPNext();
|
||||||
}
|
}
|
||||||
UNLOCK(pe->PELock);
|
UNLOCKPE(25,pe);
|
||||||
|
|
||||||
d0 = pe->ArityOfPE;
|
d0 = pe->ArityOfPE;
|
||||||
/* save S for ModuleName */
|
/* save S for ModuleName */
|
||||||
@ -8582,7 +8582,7 @@ Yap_absmi(int inp)
|
|||||||
ENDCACHE_Y();
|
ENDCACHE_Y();
|
||||||
#if defined(YAPOR) || defined(THREADS)
|
#if defined(YAPOR) || defined(THREADS)
|
||||||
if (PREG == FAILCODE) {
|
if (PREG == FAILCODE) {
|
||||||
UNLOCK(PP->PELock);
|
UNLOCKPE(26,PP);
|
||||||
PP = NULL;
|
PP = NULL;
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
129
C/cdmgr.c
129
C/cdmgr.c
@ -2119,7 +2119,7 @@ addclause(Term t, yamop *cp, int mode, Term mod, Term *t4ref)
|
|||||||
(p->ModuleOfPred == PROLOG_MODULE &&
|
(p->ModuleOfPred == PROLOG_MODULE &&
|
||||||
mod != TermProlog && mod) ) {
|
mod != TermProlog && mod) ) {
|
||||||
addcl_permission_error(RepAtom(at), Arity, FALSE);
|
addcl_permission_error(RepAtom(at), Arity, FALSE);
|
||||||
UNLOCK(p->PELock);
|
UNLOCKPE(30,p);
|
||||||
return TermNil;
|
return TermNil;
|
||||||
}
|
}
|
||||||
/* we are redefining a prolog module predicate */
|
/* we are redefining a prolog module predicate */
|
||||||
@ -2195,7 +2195,7 @@ addclause(Term t, yamop *cp, int mode, Term mod, Term *t4ref)
|
|||||||
not_was_reconsulted(p, t, TRUE);
|
not_was_reconsulted(p, t, TRUE);
|
||||||
/* always check if we have a valid error first */
|
/* always check if we have a valid error first */
|
||||||
if (Yap_ErrorMessage && Yap_Error_TYPE == PERMISSION_ERROR_MODIFY_STATIC_PROCEDURE) {
|
if (Yap_ErrorMessage && Yap_Error_TYPE == PERMISSION_ERROR_MODIFY_STATIC_PROCEDURE) {
|
||||||
UNLOCK(p->PELock);
|
UNLOCKPE(31,p);
|
||||||
return TermNil;
|
return TermNil;
|
||||||
}
|
}
|
||||||
if (pflags & UDIPredFlag) {
|
if (pflags & UDIPredFlag) {
|
||||||
@ -2263,7 +2263,7 @@ addclause(Term t, yamop *cp, int mode, Term mod, Term *t4ref)
|
|||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
UNLOCK(p->PELock);
|
UNLOCKPE(32,p);
|
||||||
if (pflags & LogUpdatePredFlag) {
|
if (pflags & LogUpdatePredFlag) {
|
||||||
LogUpdClause *cl = (LogUpdClause *)ClauseCodeToLogUpdClause(cp);
|
LogUpdClause *cl = (LogUpdClause *)ClauseCodeToLogUpdClause(cp);
|
||||||
tf = MkDBRefTerm((DBRef)cl);
|
tf = MkDBRefTerm((DBRef)cl);
|
||||||
@ -2733,12 +2733,12 @@ p_purge_clauses(void)
|
|||||||
return (FALSE);
|
return (FALSE);
|
||||||
PELOCK(21,pred);
|
PELOCK(21,pred);
|
||||||
if (pred->PredFlags & StandardPredFlag) {
|
if (pred->PredFlags & StandardPredFlag) {
|
||||||
UNLOCK(pred->PELock);
|
UNLOCKPE(33,pred);
|
||||||
Yap_Error(PERMISSION_ERROR_MODIFY_STATIC_PROCEDURE, t, "assert/1");
|
Yap_Error(PERMISSION_ERROR_MODIFY_STATIC_PROCEDURE, t, "assert/1");
|
||||||
return (FALSE);
|
return (FALSE);
|
||||||
}
|
}
|
||||||
purge_clauses(pred);
|
purge_clauses(pred);
|
||||||
UNLOCK(pred->PELock);
|
UNLOCKPE(34,pred);
|
||||||
return (TRUE);
|
return (TRUE);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -2777,12 +2777,12 @@ p_setspy(void)
|
|||||||
PELOCK(22,pred);
|
PELOCK(22,pred);
|
||||||
restart_spy:
|
restart_spy:
|
||||||
if (pred->PredFlags & (CPredFlag | SafePredFlag)) {
|
if (pred->PredFlags & (CPredFlag | SafePredFlag)) {
|
||||||
UNLOCK(pred->PELock);
|
UNLOCKPE(35,pred);
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
if (pred->OpcodeOfPred == UNDEF_OPCODE ||
|
if (pred->OpcodeOfPred == UNDEF_OPCODE ||
|
||||||
pred->OpcodeOfPred == FAIL_OPCODE) {
|
pred->OpcodeOfPred == FAIL_OPCODE) {
|
||||||
UNLOCK(pred->PELock);
|
UNLOCKPE(36,pred);
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
if (pred->OpcodeOfPred == INDEX_OPCODE) {
|
if (pred->OpcodeOfPred == INDEX_OPCODE) {
|
||||||
@ -2803,7 +2803,7 @@ p_setspy(void)
|
|||||||
pred->CodeOfPred = (yamop *)(&(pred->OpcodeOfPred));
|
pred->CodeOfPred = (yamop *)(&(pred->OpcodeOfPred));
|
||||||
}
|
}
|
||||||
pred->PredFlags |= SpiedPredFlag;
|
pred->PredFlags |= SpiedPredFlag;
|
||||||
UNLOCK(pred->PELock);
|
UNLOCKPE(37,pred);
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -2831,14 +2831,14 @@ p_rmspy(void)
|
|||||||
return FALSE;
|
return FALSE;
|
||||||
PELOCK(23,pred);
|
PELOCK(23,pred);
|
||||||
if (!(pred->PredFlags & SpiedPredFlag)) {
|
if (!(pred->PredFlags & SpiedPredFlag)) {
|
||||||
UNLOCK(pred->PELock);
|
UNLOCKPE(38,pred);
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
#if THREADS
|
#if THREADS
|
||||||
if (!(pred->PredFlags & ThreadLocalPredFlag)) {
|
if (!(pred->PredFlags & ThreadLocalPredFlag)) {
|
||||||
pred->OpcodeOfPred = Yap_opcode(_thread_local);
|
pred->OpcodeOfPred = Yap_opcode(_thread_local);
|
||||||
pred->PredFlags ^= SpiedPredFlag;
|
pred->PredFlags ^= SpiedPredFlag;
|
||||||
UNLOCK(pred->PELock);
|
UNLOCKPE(39,pred);
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
@ -2859,12 +2859,12 @@ p_rmspy(void)
|
|||||||
} else if (pred->OpcodeOfPred == Yap_opcode(_spy_or_trymark)) {
|
} else if (pred->OpcodeOfPred == Yap_opcode(_spy_or_trymark)) {
|
||||||
pred->OpcodeOfPred = Yap_opcode(_try_and_mark);
|
pred->OpcodeOfPred = Yap_opcode(_try_and_mark);
|
||||||
} else {
|
} else {
|
||||||
UNLOCK(pred->PELock);
|
UNLOCKPE(39,pred);
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
pred->PredFlags ^= SpiedPredFlag;
|
pred->PredFlags ^= SpiedPredFlag;
|
||||||
UNLOCK(pred->PELock);
|
UNLOCKPE(40,pred);
|
||||||
return (TRUE);
|
return (TRUE);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -2899,7 +2899,7 @@ p_number_of_clauses(void)
|
|||||||
return FALSE;
|
return FALSE;
|
||||||
PELOCK(24,RepPredProp(pe));
|
PELOCK(24,RepPredProp(pe));
|
||||||
ncl = RepPredProp(pe)->cs.p_code.NOfClauses;
|
ncl = RepPredProp(pe)->cs.p_code.NOfClauses;
|
||||||
UNLOCK(RepPredProp(pe)->PELock);
|
UNLOCKPE(41,RepPredProp(pe));
|
||||||
return (Yap_unify_constant(ARG3, MkIntegerTerm(ncl)));
|
return (Yap_unify_constant(ARG3, MkIntegerTerm(ncl)));
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -2914,7 +2914,7 @@ p_in_use(void)
|
|||||||
return FALSE;
|
return FALSE;
|
||||||
PELOCK(25,pe);
|
PELOCK(25,pe);
|
||||||
out = static_in_use(pe,TRUE);
|
out = static_in_use(pe,TRUE);
|
||||||
UNLOCK(pe->PELock);
|
UNLOCKPE(42,pe);
|
||||||
return(out);
|
return(out);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -2952,7 +2952,7 @@ p_new_multifile(void)
|
|||||||
/* static */
|
/* static */
|
||||||
pe->PredFlags |= (SourcePredFlag|CompiledPredFlag);
|
pe->PredFlags |= (SourcePredFlag|CompiledPredFlag);
|
||||||
}
|
}
|
||||||
UNLOCK(pe->PELock);
|
UNLOCKPE(43,pe);
|
||||||
return (TRUE);
|
return (TRUE);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -2968,7 +2968,7 @@ p_is_multifile(void)
|
|||||||
return FALSE;
|
return FALSE;
|
||||||
PELOCK(27,pe);
|
PELOCK(27,pe);
|
||||||
out = (pe->PredFlags & MultiFileFlag);
|
out = (pe->PredFlags & MultiFileFlag);
|
||||||
UNLOCK(pe->PELock);
|
UNLOCKPE(44,pe);
|
||||||
return(out);
|
return(out);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -2981,9 +2981,9 @@ p_is_log_updatable(void)
|
|||||||
pe = get_pred(Deref(ARG1), Deref(ARG2), "$is_log_updatable");
|
pe = get_pred(Deref(ARG1), Deref(ARG2), "$is_log_updatable");
|
||||||
if (EndOfPAEntr(pe))
|
if (EndOfPAEntr(pe))
|
||||||
return FALSE;
|
return FALSE;
|
||||||
LOCK(pe->PELock);
|
PELOCK(27,pe);
|
||||||
out = (pe->PredFlags & LogUpdatePredFlag);
|
out = (pe->PredFlags & LogUpdatePredFlag);
|
||||||
UNLOCK(pe->PELock);
|
UNLOCKPE(45,pe);
|
||||||
return(out);
|
return(out);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -2996,9 +2996,9 @@ p_is_source(void)
|
|||||||
pe = get_pred(Deref(ARG1), Deref(ARG2), "$is_source");
|
pe = get_pred(Deref(ARG1), Deref(ARG2), "$is_source");
|
||||||
if (EndOfPAEntr(pe))
|
if (EndOfPAEntr(pe))
|
||||||
return FALSE;
|
return FALSE;
|
||||||
LOCK(pe->PELock);
|
PELOCK(28,pe);
|
||||||
out = (pe->PredFlags & SourcePredFlag);
|
out = (pe->PredFlags & SourcePredFlag);
|
||||||
UNLOCK(pe->PELock);
|
UNLOCKPE(46,pe);
|
||||||
return(out);
|
return(out);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -3011,17 +3011,17 @@ p_owner_file(void)
|
|||||||
pe = get_pred(Deref(ARG1), Deref(ARG2), "$is_source");
|
pe = get_pred(Deref(ARG1), Deref(ARG2), "$is_source");
|
||||||
if (EndOfPAEntr(pe))
|
if (EndOfPAEntr(pe))
|
||||||
return FALSE;
|
return FALSE;
|
||||||
LOCK(pe->PELock);
|
PELOCK(29,pe);
|
||||||
if (pe->ModuleOfPred == IDB_MODULE) {
|
if (pe->ModuleOfPred == IDB_MODULE) {
|
||||||
UNLOCK(pe->PELock);
|
UNLOCKPE(47,pe);
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
if (pe->PredFlags & MultiFileFlag) {
|
if (pe->PredFlags & MultiFileFlag) {
|
||||||
UNLOCK(pe->PELock);
|
UNLOCKPE(48,pe);
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
owner = pe->src.OwnerFile;
|
owner = pe->src.OwnerFile;
|
||||||
UNLOCK(pe->PELock);
|
UNLOCKPE(49,pe);
|
||||||
return Yap_unify(ARG3, MkAtomTerm(owner));
|
return Yap_unify(ARG3, MkAtomTerm(owner));
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -3033,11 +3033,11 @@ p_mk_d(void)
|
|||||||
pe = get_pred(Deref(ARG1), Deref(ARG2), "$is_source");
|
pe = get_pred(Deref(ARG1), Deref(ARG2), "$is_source");
|
||||||
if (EndOfPAEntr(pe))
|
if (EndOfPAEntr(pe))
|
||||||
return FALSE;
|
return FALSE;
|
||||||
LOCK(pe->PELock);
|
PELOCK(30,pe);
|
||||||
if (pe->OpcodeOfPred == UNDEF_OPCODE) {
|
if (pe->OpcodeOfPred == UNDEF_OPCODE) {
|
||||||
pe->OpcodeOfPred = FAIL_OPCODE;
|
pe->OpcodeOfPred = FAIL_OPCODE;
|
||||||
}
|
}
|
||||||
UNLOCK(pe->PELock);
|
UNLOCKPE(50,pe);
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -3050,9 +3050,9 @@ p_is_dynamic(void)
|
|||||||
pe = get_pred(Deref(ARG1), Deref(ARG2), "$is_dynamic");
|
pe = get_pred(Deref(ARG1), Deref(ARG2), "$is_dynamic");
|
||||||
if (EndOfPAEntr(pe))
|
if (EndOfPAEntr(pe))
|
||||||
return FALSE;
|
return FALSE;
|
||||||
LOCK(pe->PELock);
|
PELOCK(31,pe);
|
||||||
out = (pe->PredFlags & (DynamicPredFlag|LogUpdatePredFlag));
|
out = (pe->PredFlags & (DynamicPredFlag|LogUpdatePredFlag));
|
||||||
UNLOCK(pe->PELock);
|
UNLOCKPE(51,pe);
|
||||||
return(out);
|
return(out);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -3065,9 +3065,9 @@ p_is_metapredicate(void)
|
|||||||
pe = get_pred(Deref(ARG1), Deref(ARG2), "$is_meta");
|
pe = get_pred(Deref(ARG1), Deref(ARG2), "$is_meta");
|
||||||
if (EndOfPAEntr(pe))
|
if (EndOfPAEntr(pe))
|
||||||
return FALSE;
|
return FALSE;
|
||||||
LOCK(pe->PELock);
|
PELOCK(32,pe);
|
||||||
out = (pe->PredFlags & MetaPredFlag);
|
out = (pe->PredFlags & MetaPredFlag);
|
||||||
UNLOCK(pe->PELock);
|
UNLOCKPE(52,pe);
|
||||||
return out;
|
return out;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -3128,9 +3128,9 @@ p_is_expandgoalormetapredicate(void)
|
|||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
LOCK(pe->PELock);
|
PELOCK(33,pe);
|
||||||
out = (pe->PredFlags & (GoalExPredFlag|MetaPredFlag));
|
out = (pe->PredFlags & (GoalExPredFlag|MetaPredFlag));
|
||||||
UNLOCK(pe->PELock);
|
UNLOCKPE(53,pe);
|
||||||
return(out);
|
return(out);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -3143,13 +3143,13 @@ p_pred_exists(void)
|
|||||||
pe = get_pred(Deref(ARG1), Deref(ARG2), "$exists");
|
pe = get_pred(Deref(ARG1), Deref(ARG2), "$exists");
|
||||||
if (EndOfPAEntr(pe))
|
if (EndOfPAEntr(pe))
|
||||||
return FALSE;
|
return FALSE;
|
||||||
LOCK(pe->PELock);
|
PELOCK(34,pe);
|
||||||
if (pe->PredFlags & HiddenPredFlag){
|
if (pe->PredFlags & HiddenPredFlag){
|
||||||
UNLOCK(pe->PELock);
|
UNLOCKPE(54,pe);
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
out = (pe->OpcodeOfPred != UNDEF_OPCODE);
|
out = (pe->OpcodeOfPred != UNDEF_OPCODE);
|
||||||
UNLOCK(pe->PELock);
|
UNLOCKPE(55,pe);
|
||||||
return out;
|
return out;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -3161,9 +3161,9 @@ p_set_pred_module(void)
|
|||||||
pe = get_pred(Deref(ARG1), CurrentModule, "set_pred_module/1");
|
pe = get_pred(Deref(ARG1), CurrentModule, "set_pred_module/1");
|
||||||
if (EndOfPAEntr(pe))
|
if (EndOfPAEntr(pe))
|
||||||
return FALSE;
|
return FALSE;
|
||||||
LOCK(pe->PELock);
|
PELOCK(35,pe);
|
||||||
pe->ModuleOfPred = Deref(ARG2);
|
pe->ModuleOfPred = Deref(ARG2);
|
||||||
UNLOCK(pe->PELock);
|
UNLOCKPE(56,pe);
|
||||||
return(TRUE);
|
return(TRUE);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -3175,16 +3175,16 @@ p_undefined(void)
|
|||||||
pe = get_pred(Deref(ARG1), Deref(ARG2), "undefined/1");
|
pe = get_pred(Deref(ARG1), Deref(ARG2), "undefined/1");
|
||||||
if (EndOfPAEntr(pe))
|
if (EndOfPAEntr(pe))
|
||||||
return TRUE;
|
return TRUE;
|
||||||
LOCK(pe->PELock);
|
PELOCK(36,pe);
|
||||||
if (pe->PredFlags & (CPredFlag|UserCPredFlag|TestPredFlag|AsmPredFlag|DynamicPredFlag|LogUpdatePredFlag)) {
|
if (pe->PredFlags & (CPredFlag|UserCPredFlag|TestPredFlag|AsmPredFlag|DynamicPredFlag|LogUpdatePredFlag)) {
|
||||||
UNLOCK(pe->PELock);
|
UNLOCKPE(57,pe);
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
if (pe->OpcodeOfPred == UNDEF_OPCODE) {
|
if (pe->OpcodeOfPred == UNDEF_OPCODE) {
|
||||||
UNLOCK(pe->PELock);
|
UNLOCKPE(58,pe);
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
UNLOCK(pe->PELock);
|
UNLOCKPE(59,pe);
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -3201,20 +3201,20 @@ p_kill_dynamic(void)
|
|||||||
pe = get_pred(Deref(ARG1), Deref(ARG2), "kill_dynamic/1");
|
pe = get_pred(Deref(ARG1), Deref(ARG2), "kill_dynamic/1");
|
||||||
if (EndOfPAEntr(pe))
|
if (EndOfPAEntr(pe))
|
||||||
return TRUE;
|
return TRUE;
|
||||||
LOCK(pe->PELock);
|
PELOCK(37,pe);
|
||||||
if (!(pe->PredFlags & (DynamicPredFlag|LogUpdatePredFlag))) {
|
if (!(pe->PredFlags & (DynamicPredFlag|LogUpdatePredFlag))) {
|
||||||
UNLOCK(pe->PELock);
|
UNLOCKPE(60,pe);
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
if (pe->cs.p_code.LastClause != pe->cs.p_code.FirstClause) {
|
if (pe->cs.p_code.LastClause != pe->cs.p_code.FirstClause) {
|
||||||
UNLOCK(pe->PELock);
|
UNLOCKPE(61,pe);
|
||||||
return (FALSE);
|
return (FALSE);
|
||||||
}
|
}
|
||||||
pe->cs.p_code.LastClause = pe->cs.p_code.FirstClause = NULL;
|
pe->cs.p_code.LastClause = pe->cs.p_code.FirstClause = NULL;
|
||||||
pe->OpcodeOfPred = UNDEF_OPCODE;
|
pe->OpcodeOfPred = UNDEF_OPCODE;
|
||||||
pe->cs.p_code.TrueCodeOfPred = pe->CodeOfPred = (yamop *)(&(pe->OpcodeOfPred));
|
pe->cs.p_code.TrueCodeOfPred = pe->CodeOfPred = (yamop *)(&(pe->OpcodeOfPred));
|
||||||
pe->PredFlags = pe->PredFlags & GoalExPredFlag;
|
pe->PredFlags = pe->PredFlags & GoalExPredFlag;
|
||||||
UNLOCK(pe->PELock);
|
UNLOCKPE(62,pe);
|
||||||
return (TRUE);
|
return (TRUE);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -3317,7 +3317,7 @@ search_for_static_predicate_in_use(PredEntry *p, int check_everything)
|
|||||||
if (pe == p) {
|
if (pe == p) {
|
||||||
if (check_everything)
|
if (check_everything)
|
||||||
return TRUE;
|
return TRUE;
|
||||||
LOCK(pe->PELock);
|
PELOCK(38,p);
|
||||||
if (p->PredFlags & IndexedPredFlag) {
|
if (p->PredFlags & IndexedPredFlag) {
|
||||||
yamop *code_p = b_ptr->cp_ap;
|
yamop *code_p = b_ptr->cp_ap;
|
||||||
yamop *code_beg = p->cs.p_code.TrueCodeOfPred;
|
yamop *code_beg = p->cs.p_code.TrueCodeOfPred;
|
||||||
@ -3340,7 +3340,7 @@ search_for_static_predicate_in_use(PredEntry *p, int check_everything)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
UNLOCK(pe->PELock);
|
UNLOCKPE(63,pe);
|
||||||
}
|
}
|
||||||
env_ptr = b_ptr->cp_env;
|
env_ptr = b_ptr->cp_env;
|
||||||
b_ptr = b_ptr->cp_b;
|
b_ptr = b_ptr->cp_b;
|
||||||
@ -3353,7 +3353,7 @@ mark_pred(int mark, PredEntry *pe)
|
|||||||
{
|
{
|
||||||
/* if the predicate is static mark it */
|
/* if the predicate is static mark it */
|
||||||
if (pe->ModuleOfPred) {
|
if (pe->ModuleOfPred) {
|
||||||
LOCK(pe->PELock);
|
PELOCK(39,p);
|
||||||
if (mark) {
|
if (mark) {
|
||||||
pe->PredFlags |= InUsePredFlag;
|
pe->PredFlags |= InUsePredFlag;
|
||||||
} else {
|
} else {
|
||||||
@ -3746,7 +3746,7 @@ static int
|
|||||||
cl_code_in_pred(PredEntry *pp, yamop *codeptr, CODEADDR *startp, CODEADDR *endp) {
|
cl_code_in_pred(PredEntry *pp, yamop *codeptr, CODEADDR *startp, CODEADDR *endp) {
|
||||||
Int out;
|
Int out;
|
||||||
|
|
||||||
LOCK(pp->PELock);
|
PELOCK(39,pp);
|
||||||
/* check if the codeptr comes from the indexing code */
|
/* check if the codeptr comes from the indexing code */
|
||||||
if (pp->PredFlags & IndexedPredFlag) {
|
if (pp->PredFlags & IndexedPredFlag) {
|
||||||
if (pp->PredFlags & LogUpdatePredFlag) {
|
if (pp->PredFlags & LogUpdatePredFlag) {
|
||||||
@ -3786,7 +3786,7 @@ static Int
|
|||||||
code_in_pred(PredEntry *pp, Atom *pat, UInt *parity, yamop *codeptr) {
|
code_in_pred(PredEntry *pp, Atom *pat, UInt *parity, yamop *codeptr) {
|
||||||
Int out;
|
Int out;
|
||||||
|
|
||||||
LOCK(pp->PELock);
|
PELOCK(40,pp);
|
||||||
/* check if the codeptr comes from the indexing code */
|
/* check if the codeptr comes from the indexing code */
|
||||||
if (pp->PredFlags & IndexedPredFlag) {
|
if (pp->PredFlags & IndexedPredFlag) {
|
||||||
if (pp->PredFlags & LogUpdatePredFlag) {
|
if (pp->PredFlags & LogUpdatePredFlag) {
|
||||||
@ -4535,7 +4535,12 @@ fetch_next_lu_clause(PredEntry *pe, yamop *i_code, Term th, Term tb, Term tr, ya
|
|||||||
}
|
}
|
||||||
P = cl->ClCode;
|
P = cl->ClCode;
|
||||||
#if defined(YAPOR) || defined(THREADS)
|
#if defined(YAPOR) || defined(THREADS)
|
||||||
PP = pe;
|
if (pe->PredFlags & ThreadLocalPredFlag) {
|
||||||
|
/* we don't actually need to execute code */
|
||||||
|
UNLOCK(pe->PELock);
|
||||||
|
} else {
|
||||||
|
PP = pe;
|
||||||
|
}
|
||||||
#endif
|
#endif
|
||||||
} else {
|
} else {
|
||||||
/* we don't actually need to execute code */
|
/* we don't actually need to execute code */
|
||||||
@ -4597,6 +4602,8 @@ p_log_update_clause(void)
|
|||||||
Int ret;
|
Int ret;
|
||||||
yamop *new_cp;
|
yamop *new_cp;
|
||||||
|
|
||||||
|
if (vscx==444)
|
||||||
|
jmp_deb(1);
|
||||||
if (P->opc == EXECUTE_CPRED_OP_CODE) {
|
if (P->opc == EXECUTE_CPRED_OP_CODE) {
|
||||||
new_cp = CP;
|
new_cp = CP;
|
||||||
} else {
|
} else {
|
||||||
@ -4605,7 +4612,7 @@ p_log_update_clause(void)
|
|||||||
pe = get_pred(t1, Deref(ARG2), "clause/3");
|
pe = get_pred(t1, Deref(ARG2), "clause/3");
|
||||||
if (pe == NULL || EndOfPAEntr(pe))
|
if (pe == NULL || EndOfPAEntr(pe))
|
||||||
return FALSE;
|
return FALSE;
|
||||||
LOCK(pe->PELock);
|
PELOCK(41,pe);
|
||||||
ret = fetch_next_lu_clause(pe, pe->CodeOfPred, t1, ARG3, ARG4, new_cp, TRUE);
|
ret = fetch_next_lu_clause(pe, pe->CodeOfPred, t1, ARG3, ARG4, new_cp, TRUE);
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
@ -4616,7 +4623,7 @@ p_continue_log_update_clause(void)
|
|||||||
PredEntry *pe = (PredEntry *)IntegerOfTerm(Deref(ARG1));
|
PredEntry *pe = (PredEntry *)IntegerOfTerm(Deref(ARG1));
|
||||||
yamop *ipc = (yamop *)IntegerOfTerm(ARG2);
|
yamop *ipc = (yamop *)IntegerOfTerm(ARG2);
|
||||||
|
|
||||||
LOCK(pe->PELock);
|
PELOCK(42,pe);
|
||||||
return fetch_next_lu_clause(pe, ipc, Deref(ARG3), ARG4, ARG5, B->cp_cp, FALSE);
|
return fetch_next_lu_clause(pe, ipc, Deref(ARG3), ARG4, ARG5, B->cp_cp, FALSE);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -4750,7 +4757,7 @@ p_log_update_clause_erase(void)
|
|||||||
pe = get_pred(t1, Deref(ARG2), "clause/3");
|
pe = get_pred(t1, Deref(ARG2), "clause/3");
|
||||||
if (pe == NULL || EndOfPAEntr(pe))
|
if (pe == NULL || EndOfPAEntr(pe))
|
||||||
return FALSE;
|
return FALSE;
|
||||||
LOCK(pe->PELock);
|
PELOCK(43,pe);
|
||||||
ret = fetch_next_lu_clause_erase(pe, pe->CodeOfPred, t1, ARG3, ARG4, new_cp, TRUE);
|
ret = fetch_next_lu_clause_erase(pe, pe->CodeOfPred, t1, ARG3, ARG4, new_cp, TRUE);
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
@ -4761,7 +4768,7 @@ p_continue_log_update_clause_erase(void)
|
|||||||
PredEntry *pe = (PredEntry *)IntegerOfTerm(Deref(ARG1));
|
PredEntry *pe = (PredEntry *)IntegerOfTerm(Deref(ARG1));
|
||||||
yamop *ipc = (yamop *)IntegerOfTerm(ARG2);
|
yamop *ipc = (yamop *)IntegerOfTerm(ARG2);
|
||||||
|
|
||||||
LOCK(pe->PELock);
|
PELOCK(44,pe);
|
||||||
return fetch_next_lu_clause_erase(pe, ipc, Deref(ARG3), ARG4, ARG5, B->cp_cp, FALSE);
|
return fetch_next_lu_clause_erase(pe, ipc, Deref(ARG3), ARG4, ARG5, B->cp_cp, FALSE);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -4946,7 +4953,7 @@ fetch_next_static_clause(PredEntry *pe, yamop *i_code, Term th, Term tb, Term tr
|
|||||||
Terms[1] = tb;
|
Terms[1] = tb;
|
||||||
Terms[2] = tr;
|
Terms[2] = tr;
|
||||||
cl = (StaticClause *)Yap_FollowIndexingCode(pe, i_code, Terms, NEXTOP(PredStaticClause->CodeOfPred,Otapl), cp_ptr);
|
cl = (StaticClause *)Yap_FollowIndexingCode(pe, i_code, Terms, NEXTOP(PredStaticClause->CodeOfPred,Otapl), cp_ptr);
|
||||||
UNLOCK(pe->PELock);
|
PELOCK(45,pe);
|
||||||
th = Deref(Terms[0]);
|
th = Deref(Terms[0]);
|
||||||
tb = Deref(Terms[1]);
|
tb = Deref(Terms[1]);
|
||||||
tr = Deref(Terms[2]);
|
tr = Deref(Terms[2]);
|
||||||
@ -5081,7 +5088,7 @@ p_static_clause(void)
|
|||||||
pe = get_pred(t1, Deref(ARG2), "clause/3");
|
pe = get_pred(t1, Deref(ARG2), "clause/3");
|
||||||
if (pe == NULL || EndOfPAEntr(pe))
|
if (pe == NULL || EndOfPAEntr(pe))
|
||||||
return FALSE;
|
return FALSE;
|
||||||
LOCK(pe->PELock);
|
PELOCK(46,pe);
|
||||||
return fetch_next_static_clause(pe, pe->CodeOfPred, ARG1, ARG3, ARG4, new_cp, TRUE);
|
return fetch_next_static_clause(pe, pe->CodeOfPred, ARG1, ARG3, ARG4, new_cp, TRUE);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -5100,7 +5107,7 @@ p_nth_clause(void)
|
|||||||
pe = get_pred(t1, Deref(ARG2), "clause/3");
|
pe = get_pred(t1, Deref(ARG2), "clause/3");
|
||||||
if (pe == NULL || EndOfPAEntr(pe))
|
if (pe == NULL || EndOfPAEntr(pe))
|
||||||
return FALSE;
|
return FALSE;
|
||||||
LOCK(pe->PELock);
|
PELOCK(47,pe);
|
||||||
if (!(pe->PredFlags & (SourcePredFlag|LogUpdatePredFlag))) {
|
if (!(pe->PredFlags & (SourcePredFlag|LogUpdatePredFlag))) {
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
@ -5149,7 +5156,7 @@ p_continue_static_clause(void)
|
|||||||
PredEntry *pe = (PredEntry *)IntegerOfTerm(Deref(ARG1));
|
PredEntry *pe = (PredEntry *)IntegerOfTerm(Deref(ARG1));
|
||||||
yamop *ipc = (yamop *)IntegerOfTerm(ARG2);
|
yamop *ipc = (yamop *)IntegerOfTerm(ARG2);
|
||||||
|
|
||||||
LOCK(pe->PELock);
|
PELOCK(48,pe);
|
||||||
return fetch_next_static_clause(pe, ipc, Deref(ARG3), ARG4, ARG5, B->cp_ap, FALSE);
|
return fetch_next_static_clause(pe, ipc, Deref(ARG3), ARG4, ARG5, B->cp_ap, FALSE);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -5159,7 +5166,7 @@ static void
|
|||||||
add_code_in_pred(PredEntry *pp) {
|
add_code_in_pred(PredEntry *pp) {
|
||||||
yamop *clcode;
|
yamop *clcode;
|
||||||
|
|
||||||
LOCK(pp->PELock);
|
PELOCK(49,pp);
|
||||||
/* check if the codeptr comes from the indexing code */
|
/* check if the codeptr comes from the indexing code */
|
||||||
|
|
||||||
/* highly likely this is used for indexing */
|
/* highly likely this is used for indexing */
|
||||||
@ -5308,7 +5315,7 @@ p_static_pred_statistics(void)
|
|||||||
pe = get_pred( Deref(ARG1), Deref(ARG2), "predicate_statistics");
|
pe = get_pred( Deref(ARG1), Deref(ARG2), "predicate_statistics");
|
||||||
if (pe == NIL)
|
if (pe == NIL)
|
||||||
return (FALSE);
|
return (FALSE);
|
||||||
LOCK(pe->PELock);
|
PELOCK(50,pe);
|
||||||
if (pe->PredFlags & (DynamicPredFlag|LogUpdatePredFlag|UserCPredFlag|AsmPredFlag|CPredFlag|BinaryPredFlag)) {
|
if (pe->PredFlags & (DynamicPredFlag|LogUpdatePredFlag|UserCPredFlag|AsmPredFlag|CPredFlag|BinaryPredFlag)) {
|
||||||
/* should use '$recordedp' in this case */
|
/* should use '$recordedp' in this case */
|
||||||
UNLOCK(pe->PELock);
|
UNLOCK(pe->PELock);
|
||||||
|
@ -1522,7 +1522,7 @@ PredPropByAtom (Atom at, Term cur_mod)
|
|||||||
|
|
||||||
#if DEBUG_PELOCKING
|
#if DEBUG_PELOCKING
|
||||||
#define PELOCK(I,Z) \
|
#define PELOCK(I,Z) \
|
||||||
{ LOCK((Z)->PELock); (Z)->StatisticsForPred.NOfEntries=(I),(Z)->StatisticsForPred.NOfHeadSuccesses=pthread_self(); }
|
{ LOCK((Z)->PELock); (Z)->StatisticsForPred.NOfEntries=(I);(Z)->StatisticsForPred.NOfHeadSuccesses=pthread_self(); }
|
||||||
#define UNLOCKPE(I,Z) \
|
#define UNLOCKPE(I,Z) \
|
||||||
( (Z)->StatisticsForPred.NOfRetries=(I), UNLOCK((Z)->PELock) )
|
( (Z)->StatisticsForPred.NOfRetries=(I), UNLOCK((Z)->PELock) )
|
||||||
#else
|
#else
|
||||||
|
Reference in New Issue
Block a user