fix locking issues with dynamic predicates and threads (obs from Paulo Moura).

This commit is contained in:
Vitor Santos Costa 2010-03-03 22:11:50 +00:00
parent fb6c4f966c
commit 3070e4ce9d
2 changed files with 6 additions and 1 deletions

View File

@ -8143,7 +8143,6 @@ Yap_absmi(int inp)
PREG = pt0->CodeOfPred;
/* for profiler */
#ifdef THREADS
pthread_mutex_lock(&(ThreadHandle[worker_id].tlock));
UNLOCK(ThreadHandlesLock);
#endif
save_pc();

View File

@ -792,6 +792,12 @@ p_execute_nonstop(void)
if (ActiveSignals & YAP_CREEP_SIGNAL && !Yap_InterruptsDisabled) {
Yap_signal(YAP_CREEP_SIGNAL);
}
#if defined(YAPOR) || defined(THREADS)
if (RepPredProp(pe)->PredFlags & LogUpdatePredFlag) {
PP = RepPredProp(pe);
LOCK(PP->PELock);
}
#endif
return CallPredicate(RepPredProp(pe), B, RepPredProp(pe)->cs.p_code.TrueCodeOfPred);
} else { if (ActiveSignals & YAP_CREEP_SIGNAL &&
!Yap_InterruptsDisabled &&