fixes to support threads and assert correctly, even if inefficiently.

git-svn-id: https://yap.svn.sf.net/svnroot/yap/trunk@2030 b08c6af1-5177-4d33-ba66-4b1c6b8b522a
This commit is contained in:
vsc
2007-11-26 23:43:10 +00:00
parent 5941606d19
commit 3beda27d14
32 changed files with 813 additions and 860 deletions

View File

@@ -2398,6 +2398,7 @@ sweep_trail(choiceptr gc_B, tr_fr_ptr old_TR)
if (flags & IndexMask) {
LogUpdIndex *indx = ClauseFlagsToLogUpdIndex(pt0);
int erase;
LOCK(indx->ClPred->PELock);
DEC_CLREF_COUNT(indx);
indx->ClFlags &= ~InUseMask;
erase = (indx->ClFlags & ErasedMask
@@ -2407,10 +2408,12 @@ sweep_trail(choiceptr gc_B, tr_fr_ptr old_TR)
no one is accessing the clause */
Yap_ErLogUpdIndex(indx);
}
UNLOCK(indx->ClPred->PELock);
} else {
LogUpdClause *cl = ClauseFlagsToLogUpdClause(pt0);
int erase;
LOCK(cl->ClPred->PELock);
DEC_CLREF_COUNT(cl);
cl->ClFlags &= ~InUseMask;
erase = ((cl->ClFlags & ErasedMask) && !cl->ClRefCount);
@@ -2419,6 +2422,7 @@ sweep_trail(choiceptr gc_B, tr_fr_ptr old_TR)
no one is accessing the clause */
Yap_ErLogUpdCl(cl);
}
UNLOCK(cl->ClPred->PELock);
}
} else {
DynamicClause *cl = ClauseFlagsToDynamicClause(pt0);