From e6fe0650369437471b675d6ab7fff03b91806300 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rg=20F=2E=20Wittenberger?= Date: Mon, 30 Nov 2015 12:43:18 +0100 Subject: [PATCH] allow signal handlers to be called from any thread --- runtime.c | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/runtime.c b/runtime.c index 9d93476..73b820a 100644 --- a/runtime.c +++ b/runtime.c @@ -4395,17 +4395,12 @@ C_regparm void C_fcall C_paranoid_check_for_interrupt(void) C_regparm void C_fcall C_raise_interrupt(int reason) { if(C_interrupts_enabled) { - if(pending_interrupts_count == 0 && !handling_interrupts) { + if(pending_interrupts_count == 0 && saved_stack_limit != stack_bottom && !handling_interrupts) { /* Force the next stack check to fail by faking a "full" stack. That causes save_and_reclaim() to be called, which will invoke handle_interrupt() (which restores the stack limit). */ saved_stack_limit = C_stack_limit; - -#if C_STACK_GROWS_DOWNWARD - C_stack_limit = C_stack_pointer + 1000; -#else - C_stack_limit = C_stack_pointer - 1000; -#endif + C_stack_limit = stack_bottom; interrupt_time = C_cpu_milliseconds(); pending_interrupts[ pending_interrupts_count++ ] = reason; } else if(pending_interrupts_count < MAX_PENDING_INTERRUPTS) { -- 2.6.2