diff --git a/C/adtdefs.c b/C/adtdefs.c index 8871a3338..6cfa732db 100644 --- a/C/adtdefs.c +++ b/C/adtdefs.c @@ -492,6 +492,7 @@ Yap_GetPredPropByFunc(Functor f, Term cur_mod) Prop p0; READ_LOCK(f->FRWLock); + p0 = GetPredPropByFuncHavingLock(f, cur_mod); READ_UNLOCK(f->FRWLock); return (p0); @@ -646,8 +647,9 @@ Yap_NewPredPropByFunctor(FunctorEntry *fe, Term cur_mod) PredHash[hsh] = p; } PredsInHashTable++; - if (10*PredsInHashTable > 6*PredHashTableSize) + if (10*PredsInHashTable > 6*PredHashTableSize) { ExpandPredHash(); + } WRITE_UNLOCK(PredHashRWLock); /* make sure that we have something here */ RepPredProp(fe->PropsOfFE)->NextOfPE = fe->PropsOfFE; diff --git a/C/cdmgr.c b/C/cdmgr.c index 34fb55b3b..5ee3da7ad 100644 --- a/C/cdmgr.c +++ b/C/cdmgr.c @@ -11,8 +11,11 @@ * File: cdmgr.c * * comments: Code manager * * * -* Last rev: $Date: 2007-10-29 22:48:54 $,$Author: vsc $ * +* Last rev: $Date: 2007-11-01 10:01:35 $,$Author: vsc $ * * $Log: not supported by cvs2svn $ +* Revision 1.207 2007/10/29 22:48:54 vsc +* small fixes +* * Revision 1.206 2007/04/10 22:13:20 vsc * fix max modules limitation * @@ -2193,9 +2196,9 @@ p_in_this_f_before(void) if (IsVarTerm(mod = Deref(ARG3)) || !IsAtomTerm(mod)) return FALSE; if (arity) - p0 = PredPropByFunc(Yap_MkFunctor(at, arity),CurrentModule); + p0 = PredPropByFunc(Yap_MkFunctor(at, arity), mod); else - p0 = PredPropByAtom(at, CurrentModule); + p0 = PredPropByAtom(at, mod); if (ConsultSp == ConsultBase || (fp = ConsultSp)->p == p0) return (FALSE); else diff --git a/C/init.c b/C/init.c index 8b2201b58..194021107 100644 --- a/C/init.c +++ b/C/init.c @@ -1391,6 +1391,7 @@ Yap_InitWorkspace(int Heap, int Stack, int Trail, int max_table_size, for (i = 0; i < PredHashTableSize; ++i) { PredHash[i] = NULL; } + INIT_RWLOCK(PredHashRWLock); NOfAtoms = 0; NOfWideAtoms = 0; PredsInHashTable = 0; diff --git a/H/Yatom.h b/H/Yatom.h index 6071d58d8..23060abe3 100644 --- a/H/Yatom.h +++ b/H/Yatom.h @@ -1322,9 +1322,9 @@ GetPredPropByFuncHavingLock (FunctorEntry *fe, Term cur_mod) { PredEntry *p; - if (!(p = RepPredProp(fe->PropsOfFE))) + if (!(p = RepPredProp(fe->PropsOfFE))) { return NIL; - + } if ((p->ModuleOfPred == cur_mod || !(p->ModuleOfPred))) { #if THREADS /* Thread Local Predicates */ diff --git a/changes-5.1.html b/changes-5.1.html index 460de87d3..cb51121c5 100644 --- a/changes-5.1.html +++ b/changes-5.1.html @@ -17,6 +17,8 @@

Yap-5.1.3: