diff --git a/C/exec.c b/C/exec.c index 78e3ddb7e..b795a316c 100644 --- a/C/exec.c +++ b/C/exec.c @@ -174,13 +174,13 @@ do_execute(Term t, Term mod) if (PRED_GOAL_EXPANSION_ALL) { LOCK(SignalLock); /* disable creeping when we do goal expansion */ - if (ActiveSignals & YAP_CREEP_SIGNAL) { + if (ActiveSignals & YAP_CREEP_SIGNAL && !Yap_InterruptsDisabled) { ActiveSignals &= ~YAP_CREEP_SIGNAL; CreepFlag = CalculateStackGap(); } UNLOCK(SignalLock); return CallMetaCall(mod); - } else if (ActiveSignals) { + } else if (ActiveSignals && !Yap_InterruptsDisabled) { return EnterCreepMode(t, mod); } restart_exec: @@ -345,14 +345,14 @@ do_execute_n(Term t, Term mod, unsigned int n) if (PRED_GOAL_EXPANSION_ALL) { LOCK(SignalLock); /* disable creeping when we do goal expansion */ - if (ActiveSignals & YAP_CREEP_SIGNAL) { + if (ActiveSignals & YAP_CREEP_SIGNAL && !Yap_InterruptsDisabled) { ActiveSignals &= ~YAP_CREEP_SIGNAL; CreepFlag = CalculateStackGap(); } UNLOCK(SignalLock); ARG1 = copy_execn_to_heap(f, pt, n, arity, mod); return CallMetaCall(mod); - } else if (ActiveSignals) { + } else if (ActiveSignals && !Yap_InterruptsDisabled) { return EnterCreepMode(copy_execn_to_heap(f, pt, n, arity, CurrentModule), mod); } if (arity > MaxTemps) { @@ -663,7 +663,7 @@ p_execute0(void) unsigned int arity; Prop pe; - if (ActiveSignals) { + if (ActiveSignals && !Yap_InterruptsDisabled) { return EnterCreepMode(t, mod); } restart_exec: @@ -786,7 +786,7 @@ p_execute_nonstop(void) } /* N = arity; */ /* call may not define new system predicates!! */ - if (ActiveSignals & YAP_CREEP_SIGNAL) { + if (ActiveSignals & YAP_CREEP_SIGNAL && !Yap_InterruptsDisabled) { Yap_signal(YAP_CREEP_SIGNAL); } if (RepPredProp(pe)->PredFlags & SpiedPredFlag) { @@ -1674,7 +1674,7 @@ p_creep_allowed(void) { if (PP != NULL) { LOCK(SignalLock); - if (ActiveSignals & YAP_CREEP_SIGNAL) { + if (ActiveSignals & YAP_CREEP_SIGNAL && !Yap_InterruptsDisabled) { ActiveSignals &= ~YAP_CREEP_SIGNAL; if (!ActiveSignals) CreepFlag = CalculateStackGap(); diff --git a/C/stdpreds.c b/C/stdpreds.c index ad8ba5fa4..7d473dc76 100644 --- a/C/stdpreds.c +++ b/C/stdpreds.c @@ -473,7 +473,7 @@ inline static void do_signal(yap_signals sig) { LOCK(SignalLock); - if (Yap_InterruptsEnabled) + if (!Yap_InterruptsDisabled) CreepFlag = Unsigned(LCL0); ActiveSignals |= sig; UNLOCK(SignalLock);