more thread fixes

git-svn-id: https://yap.svn.sf.net/svnroot/yap/trunk@997 b08c6af1-5177-4d33-ba66-4b1c6b8b522a
This commit is contained in:
vsc
2004-02-19 19:24:46 +00:00
parent d3f49b75df
commit 026bfb3c18
13 changed files with 267 additions and 133 deletions

View File

@@ -1661,21 +1661,21 @@ cont_current_atom(void)
while (i < AtomHashTableSize) {
READ_LOCK(HashChain[i].AERWLock);
catom = HashChain[i].Entry;
READ_UNLOCK(HashChain[i].AERWLock);
if (catom != NIL) {
break;
}
READ_UNLOCK(HashChain[i].AERWLock);
i++;
}
if (i == AtomHashTableSize) {
cut_fail();
} else {
READ_UNLOCK(HashChain[i].AERWLock);
}
}
ap = RepAtom(catom);
if (Yap_unify_constant(ARG1, MkAtomTerm(catom))) {
READ_LOCK(ap->ARWLock);
if (ap->NextOfAE == NIL) {
READ_UNLOCK(ap->ARWLock);
i++;
while (i < AtomHashTableSize) {
READ_LOCK(HashChain[i].AERWLock);
@@ -1687,19 +1687,18 @@ cont_current_atom(void)
i++;
}
if (i == AtomHashTableSize) {
cut_succeed();
cut_fail();
} else {
EXTRA_CBACK_ARG(1,1) = MkAtomTerm(catom);
}
} else {
READ_LOCK(ap->ARWLock);
EXTRA_CBACK_ARG(1,1) = MkAtomTerm(ap->NextOfAE);
READ_UNLOCK(ap->ARWLock);
}
EXTRA_CBACK_ARG(1,2) = MkIntTerm(i);
return(TRUE);
return TRUE;
} else {
return(FALSE);
return FALSE;
}
}