thread support updates
git-svn-id: https://yap.svn.sf.net/svnroot/yap/trunk@1006 b08c6af1-5177-4d33-ba66-4b1c6b8b522a
This commit is contained in:
parent
58e306b815
commit
c90c3b7b34
@ -1083,6 +1083,7 @@ Yap_absmi(int inp)
|
||||
READ_LOCK(PP->PRWLock);
|
||||
if (PP->cs.p_code.TrueCodeOfPred != PREG) {
|
||||
PREG = PP->cs.p_code.TrueCodeOfPred;
|
||||
PP = NULL;
|
||||
READ_UNLOCK(PP->PRWLock);
|
||||
GONext();
|
||||
}
|
||||
@ -6377,10 +6378,6 @@ Yap_absmi(int inp)
|
||||
#endif
|
||||
saveregs();
|
||||
pt0 = Yap_ExpandIndex(pe);
|
||||
if (PP == NULL) {
|
||||
READ_UNLOCK(pe->PRWLock);
|
||||
PP = pe;
|
||||
}
|
||||
/* restart index */
|
||||
setregs();
|
||||
UNLOCK(pe->PELock);
|
||||
|
@ -3146,8 +3146,8 @@ fetch_next_lu_clause(PredEntry *pe, yamop *i_code, Term th, Term tb, Term tr, ya
|
||||
#endif
|
||||
#if defined(YAPOR) || defined(THREADS)
|
||||
if (PP == pe) {
|
||||
PP = NULL;
|
||||
READ_UNLOCK(pe->PRWLock);
|
||||
PP = NULL;
|
||||
}
|
||||
#endif
|
||||
#if defined(YAPOR) || defined(THREADS)
|
||||
@ -3172,9 +3172,7 @@ fetch_next_lu_clause(PredEntry *pe, yamop *i_code, Term th, Term tb, Term tr, ya
|
||||
YENV = ASP;
|
||||
YENV[E_CB] = (CELL) B;
|
||||
}
|
||||
READ_LOCK(pe->PRWLock);
|
||||
P = cl->ClCode;
|
||||
READ_UNLOCK(pe->PRWLock);
|
||||
}
|
||||
return TRUE;
|
||||
} else {
|
||||
@ -3242,8 +3240,8 @@ fetch_next_lu_clause0(PredEntry *pe, yamop *i_code, Term th, Term tb, yamop *cp_
|
||||
cl = Yap_FollowIndexingCode(pe, i_code, th, tb, TermNil, NEXTOP(PredLogUpdClause0->CodeOfPred,ld), cp_ptr);
|
||||
#if defined(YAPOR) || defined(THREADS)
|
||||
if (PP == pe) {
|
||||
PP = NULL;
|
||||
READ_UNLOCK(pe->PRWLock);
|
||||
PP = NULL;
|
||||
}
|
||||
#endif
|
||||
if (cl == NULL) {
|
||||
@ -3267,9 +3265,7 @@ fetch_next_lu_clause0(PredEntry *pe, yamop *i_code, Term th, Term tb, yamop *cp_
|
||||
YENV = ASP;
|
||||
YENV[E_CB] = (CELL) B;
|
||||
}
|
||||
READ_LOCK(pe->PRWLock);
|
||||
P = cl->ClCode;
|
||||
READ_UNLOCK(pe->PRWLock);
|
||||
}
|
||||
return TRUE;
|
||||
} else {
|
||||
|
@ -3280,6 +3280,7 @@ c_recorded(int flags)
|
||||
static Int
|
||||
lu_recorded(PredEntry *pe) {
|
||||
op_numbers opc = Yap_op_from_opcode(P->opc);
|
||||
|
||||
if (opc == _procceed) {
|
||||
P = pe->CodeOfPred;
|
||||
} else {
|
||||
|
11
C/exec.c
11
C/exec.c
@ -1349,16 +1349,13 @@ Yap_RunTopGoal(Term t)
|
||||
return(FALSE);
|
||||
}
|
||||
ppe = RepPredProp(pe);
|
||||
if (pe != NIL) {
|
||||
READ_LOCK(ppe->PRWLock);
|
||||
} else if (pe == NIL) {
|
||||
if (pe == NIL) {
|
||||
/* we must always start the emulator with Prolog code */
|
||||
return(FALSE);
|
||||
return FALSE;
|
||||
}
|
||||
READ_LOCK(ppe->PRWLock);
|
||||
CodeAdr = ppe->CodeOfPred;
|
||||
if (pe != NIL) {
|
||||
READ_UNLOCK(ppe->PRWLock);
|
||||
}
|
||||
READ_UNLOCK(ppe->PRWLock);
|
||||
if (Yap_TrailTop - HeapTop < 2048) {
|
||||
Yap_PrologMode = BootMode;
|
||||
Yap_Error(SYSTEM_ERROR,TermNil,
|
||||
|
@ -293,3 +293,4 @@ Yap_InitLowLevelTrace(void)
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
|
Reference in New Issue
Block a user