X-Git-Url: http://repo.macrolet.net/gitweb/?a=blobdiff_plain;ds=sidebyside;f=src%2Fruntime%2Finterrupt.c;h=d822ceb73b1fd77c555b25bf5e867ed0c871e6fe;hb=70227794f1eefb567c13ec04f7bd6d3b6794aa29;hp=e82a8cd4f1a4398ce89b416638e2a861866d3d45;hpb=6208e9ee15dbdea405f53d70046f034fc3e0777b;p=sbcl.git diff --git a/src/runtime/interrupt.c b/src/runtime/interrupt.c index e82a8cd..d822ceb 100644 --- a/src/runtime/interrupt.c +++ b/src/runtime/interrupt.c @@ -83,7 +83,6 @@ void sigaddset_deferrable(sigset_t *s) sigaddset(s, SIGPIPE); sigaddset(s, SIGALRM); sigaddset(s, SIGURG); - sigaddset(s, SIGFPE); sigaddset(s, SIGTSTP); sigaddset(s, SIGCHLD); sigaddset(s, SIGIO); @@ -157,17 +156,7 @@ void reset_signal_mask () thread_sigmask(SIG_SETMASK,&new,0); } -void block_deferrable_signals_and_inhibit_gc () -{ - struct thread *thread=arch_os_get_current_thread(); - sigset_t block; - sigemptyset(&block); - sigaddset_deferrable(&block); - thread_sigmask(SIG_BLOCK, &block, 0); - bind_variable(GC_INHIBIT,T,thread); -} - -static void block_blockable_signals () +void block_blockable_signals () { sigset_t block; sigemptyset(&block); @@ -433,7 +422,8 @@ interrupt_handle_now(int signal, siginfo_t *info, void *void_context) #endif union interrupt_handler handler; check_blockables_blocked_or_lose(); - check_interrupts_enabled_or_lose(context); + if (sigismember(&deferrable_sigset,signal)) + check_interrupts_enabled_or_lose(context); #ifdef LISP_FEATURE_LINUX /* Under Linux on some architectures, we appear to have to restore @@ -615,8 +605,7 @@ maybe_now_maybe_later(int signal, siginfo_t *info, void *void_context) #ifdef LISP_FEATURE_LINUX os_restore_fp_control(context); #endif - if(maybe_defer_handler(interrupt_handle_now,data, - signal,info,context)) + if(maybe_defer_handler(interrupt_handle_now,data,signal,info,context)) return; interrupt_handle_now(signal, info, context); #ifdef LISP_FEATURE_DARWIN @@ -630,13 +619,14 @@ low_level_interrupt_handle_now(int signal, siginfo_t *info, void *void_context) { os_context_t *context = (os_context_t*)void_context; struct thread *thread=arch_os_get_current_thread(); + struct interrupt_data *data=thread->interrupt_data; #ifdef LISP_FEATURE_LINUX os_restore_fp_control(context); #endif check_blockables_blocked_or_lose(); check_interrupts_enabled_or_lose(context); - (*thread->interrupt_data->interrupt_low_level_handlers[signal]) + (*data->interrupt_low_level_handlers[signal]) (signal, info, void_context); #ifdef LISP_FEATURE_DARWIN /* Work around G5 bug */ @@ -973,8 +963,7 @@ interrupt_maybe_gc(int signal, siginfo_t *info, void *void_context) { os_context_t *context=(os_context_t *) void_context; struct thread *th=arch_os_get_current_thread(); - struct interrupt_data *data= - th ? th->interrupt_data : global_interrupt_data; + struct interrupt_data *data=th->interrupt_data; if(!foreign_function_call_active && gc_trigger_hit(signal, info, context)){ struct thread *thread=arch_os_get_current_thread(); @@ -1063,6 +1052,7 @@ undoably_install_low_level_interrupt_handler (int signal, { struct sigaction sa; struct thread *th=arch_os_get_current_thread(); + /* It may be before the initial thread is started. */ struct interrupt_data *data= th ? th->interrupt_data : global_interrupt_data; @@ -1100,6 +1090,7 @@ install_handler(int signal, void handler(int, siginfo_t*, void*)) sigset_t old, new; union interrupt_handler oldhandler; struct thread *th=arch_os_get_current_thread(); + /* It may be before the initial thread is started. */ struct interrupt_data *data= th ? th->interrupt_data : global_interrupt_data;