MULTIPLE_STACKS - or-parallelism/threads/tabling

YAPOR_THREADS - threads with or-parallelism
make tabling require reference counting for dynamic predicates.
This commit is contained in:
Vítor Santos Costa
2011-04-14 18:51:11 +01:00
parent 4de6a9e3ef
commit 8fb8aec9bf
16 changed files with 98 additions and 70 deletions

View File

@@ -392,7 +392,7 @@ AccessNamedArray(Atom a, Int indx USES_REGS)
if (TRef != 0L) {
DBRef ref = DBRefOfTerm(TRef);
#if defined(YAPOR) || defined(THREADS)
#if MULTIPLE_STACKS
LOCK(ref->lock);
INC_DBREF_COUNT(ref);
TRAIL_REF(ref); /* So that fail will erase it */
@@ -2305,17 +2305,17 @@ p_static_array_to_term( USES_REGS1 )
if (TRef != 0L) {
DBRef ref = DBRefOfTerm(TRef);
#if defined(YAPOR) || defined(THREADS)
LOCK(ref->lock);
#if MULTIPLE_STACKS
INC_DBREF_COUNT(ref);
TRAIL_REF(ref); /* So that fail will erase it */
UNLOCK(ref->lock);
#else
if (!(ref->Flags & InUseMask)) {
ref->Flags |= InUseMask;
TRAIL_REF(ref); /* So that fail will erase it */
}
#endif
UNLOCK(ref->lock);
} else {
TRef = TermNil;
}