X-Git-Url: http://repo.macrolet.net/gitweb/?a=blobdiff_plain;f=src%2Fruntime%2Finterrupt.c;h=bae3923795aea8bf4a8abede77dfbb5b09fc92ac;hb=01044af1b8d69fc3899dc0417064c1512223223d;hp=aecee17b56f2b1d9828d8f7a2bf63bdd8230c186;hpb=5e9825374b74df450d8cfb2c005e6bef30197734;p=sbcl.git diff --git a/src/runtime/interrupt.c b/src/runtime/interrupt.c index aecee17..bae3923 100644 --- a/src/runtime/interrupt.c +++ b/src/runtime/interrupt.c @@ -48,9 +48,9 @@ #include #include +#include "sbcl.h" #include "runtime.h" #include "arch.h" -#include "sbcl.h" #include "os.h" #include "interrupt.h" #include "globals.h" @@ -536,36 +536,52 @@ maybe_now_maybe_later(int signal, siginfo_t *info, void *void_context) signal,info,context)) return; interrupt_handle_now(signal, info, context); +#ifdef LISP_FEATURE_DARWIN + /* Work around G5 bug */ + sigreturn(void_context); +#endif } +#ifdef LISP_FEATURE_SB_THREAD void sig_stop_for_gc_handler(int signal, siginfo_t *info, void *void_context) { os_context_t *context = arch_os_get_context(&void_context); struct thread *thread=arch_os_get_current_thread(); struct interrupt_data *data=thread->interrupt_data; - + sigset_t ss; + int i; if(maybe_defer_handler(sig_stop_for_gc_handler,data, - signal,info,context)){ + signal,info,context)) { return; } /* need the context stored so it can have registers scavenged */ fake_foreign_function_call(context); + sigemptyset(&ss); + for(i=1;ipid); thread->state=STATE_STOPPED; release_spinlock(&all_threads_lock); - kill(thread->pid,SIGSTOP); + + sigemptyset(&ss); sigaddset(&ss,SIG_STOP_FOR_GC); + sigwaitinfo(&ss,0); undo_fake_foreign_function_call(context); } +#endif void interrupt_handle_now_handler(int signal, siginfo_t *info, void *void_context) { os_context_t *context = arch_os_get_context(&void_context); interrupt_handle_now(signal, info, context); +#ifdef LISP_FEATURE_DARWIN + sigreturn(void_context); +#endif } /* @@ -712,7 +728,7 @@ boolean handle_control_stack_guard_triggered(os_context_t *context,void *addr){ } #ifndef LISP_FEATURE_GENCGC -/* This function gets called from the SIGSEGV (for e.g. Linux or +/* This function gets called from the SIGSEGV (for e.g. Linux, NetBSD, & * OpenBSD) or SIGBUS (for e.g. FreeBSD) handler. Here we check * whether the signal was due to treading on the mprotect()ed zone - * and if so, arrange for a GC to happen. */