be careful to make sure we can hanle the interrupt.

This commit is contained in:
Vitor Santos Costa 2009-05-21 00:39:14 -05:00
parent a59a434d66
commit 88b5f1a735
2 changed files with 8 additions and 8 deletions

View File

@ -174,13 +174,13 @@ do_execute(Term t, Term mod)
if (PRED_GOAL_EXPANSION_ALL) { if (PRED_GOAL_EXPANSION_ALL) {
LOCK(SignalLock); LOCK(SignalLock);
/* disable creeping when we do goal expansion */ /* disable creeping when we do goal expansion */
if (ActiveSignals & YAP_CREEP_SIGNAL) { if (ActiveSignals & YAP_CREEP_SIGNAL && !Yap_InterruptsDisabled) {
ActiveSignals &= ~YAP_CREEP_SIGNAL; ActiveSignals &= ~YAP_CREEP_SIGNAL;
CreepFlag = CalculateStackGap(); CreepFlag = CalculateStackGap();
} }
UNLOCK(SignalLock); UNLOCK(SignalLock);
return CallMetaCall(mod); return CallMetaCall(mod);
} else if (ActiveSignals) { } else if (ActiveSignals && !Yap_InterruptsDisabled) {
return EnterCreepMode(t, mod); return EnterCreepMode(t, mod);
} }
restart_exec: restart_exec:
@ -345,14 +345,14 @@ do_execute_n(Term t, Term mod, unsigned int n)
if (PRED_GOAL_EXPANSION_ALL) { if (PRED_GOAL_EXPANSION_ALL) {
LOCK(SignalLock); LOCK(SignalLock);
/* disable creeping when we do goal expansion */ /* disable creeping when we do goal expansion */
if (ActiveSignals & YAP_CREEP_SIGNAL) { if (ActiveSignals & YAP_CREEP_SIGNAL && !Yap_InterruptsDisabled) {
ActiveSignals &= ~YAP_CREEP_SIGNAL; ActiveSignals &= ~YAP_CREEP_SIGNAL;
CreepFlag = CalculateStackGap(); CreepFlag = CalculateStackGap();
} }
UNLOCK(SignalLock); UNLOCK(SignalLock);
ARG1 = copy_execn_to_heap(f, pt, n, arity, mod); ARG1 = copy_execn_to_heap(f, pt, n, arity, mod);
return CallMetaCall(mod); return CallMetaCall(mod);
} else if (ActiveSignals) { } else if (ActiveSignals && !Yap_InterruptsDisabled) {
return EnterCreepMode(copy_execn_to_heap(f, pt, n, arity, CurrentModule), mod); return EnterCreepMode(copy_execn_to_heap(f, pt, n, arity, CurrentModule), mod);
} }
if (arity > MaxTemps) { if (arity > MaxTemps) {
@ -663,7 +663,7 @@ p_execute0(void)
unsigned int arity; unsigned int arity;
Prop pe; Prop pe;
if (ActiveSignals) { if (ActiveSignals && !Yap_InterruptsDisabled) {
return EnterCreepMode(t, mod); return EnterCreepMode(t, mod);
} }
restart_exec: restart_exec:
@ -786,7 +786,7 @@ p_execute_nonstop(void)
} }
/* N = arity; */ /* N = arity; */
/* call may not define new system predicates!! */ /* call may not define new system predicates!! */
if (ActiveSignals & YAP_CREEP_SIGNAL) { if (ActiveSignals & YAP_CREEP_SIGNAL && !Yap_InterruptsDisabled) {
Yap_signal(YAP_CREEP_SIGNAL); Yap_signal(YAP_CREEP_SIGNAL);
} }
if (RepPredProp(pe)->PredFlags & SpiedPredFlag) { if (RepPredProp(pe)->PredFlags & SpiedPredFlag) {
@ -1674,7 +1674,7 @@ p_creep_allowed(void)
{ {
if (PP != NULL) { if (PP != NULL) {
LOCK(SignalLock); LOCK(SignalLock);
if (ActiveSignals & YAP_CREEP_SIGNAL) { if (ActiveSignals & YAP_CREEP_SIGNAL && !Yap_InterruptsDisabled) {
ActiveSignals &= ~YAP_CREEP_SIGNAL; ActiveSignals &= ~YAP_CREEP_SIGNAL;
if (!ActiveSignals) if (!ActiveSignals)
CreepFlag = CalculateStackGap(); CreepFlag = CalculateStackGap();

View File

@ -473,7 +473,7 @@ inline static void
do_signal(yap_signals sig) do_signal(yap_signals sig)
{ {
LOCK(SignalLock); LOCK(SignalLock);
if (Yap_InterruptsEnabled) if (!Yap_InterruptsDisabled)
CreepFlag = Unsigned(LCL0); CreepFlag = Unsigned(LCL0);
ActiveSignals |= sig; ActiveSignals |= sig;
UNLOCK(SignalLock); UNLOCK(SignalLock);