X-Git-Url: http://repo.macrolet.net/gitweb/?a=blobdiff_plain;ds=inline;f=src%2Fruntime%2Finterrupt.c;h=cb85bee726cb0fd8c4040710520e13ed77d642ac;hb=310aee0b439b715a5ec242862ab0a4d254e123b5;hp=a2663017c7a363b7d9c9f8db6fca1502f73ba5d2;hpb=d4d6c4b16a3655ce99a87d43f411391363531260;p=sbcl.git diff --git a/src/runtime/interrupt.c b/src/runtime/interrupt.c index a266301..cb85bee 100644 --- a/src/runtime/interrupt.c +++ b/src/runtime/interrupt.c @@ -346,6 +346,12 @@ interrupt_handle_pending(os_context_t *context) thread=arch_os_get_current_thread(); data=thread->interrupt_data; +#if defined(LISP_FEATURE_X86) || defined(LISP_FEATURE_X86_64) + /* If pseudo_atomic_interrupted is set then the interrupt is going + * to be handled now, ergo it's safe to clear it. */ + arch_clear_pseudo_atomic_interrupted(context); +#endif + if (SymbolValue(GC_INHIBIT,thread)==NIL) { #ifdef LISP_FEATURE_SB_THREAD if (SymbolValue(STOP_FOR_GC_PENDING,thread) != NIL) { @@ -1069,15 +1075,22 @@ sigaction_nodefer_test_handler(int signal, siginfo_t *info, void *void_context) static void see_if_sigaction_nodefer_works() { - struct sigaction sa; + struct sigaction sa, old_sa; sa.sa_flags = SA_SIGINFO | SA_NODEFER; sa.sa_sigaction = sigaction_nodefer_test_handler; sigemptyset(&sa.sa_mask); sigaddset(&sa.sa_mask, SIGABRT); - sigaction(SIGTRAP, &sa, NULL); - kill(getpid(), SIGTRAP); + sigaction(SIGUSR1, &sa, &old_sa); + /* Make sure no signals are blocked. */ + { + sigset_t empty; + sigemptyset(&empty); + sigprocmask(SIG_SETMASK, &empty, 0); + } + kill(getpid(), SIGUSR1); while (sigaction_nodefer_works == -1); + sigaction(SIGUSR1, &old_sa, NULL); } static void