0.9.7.10:
[sbcl.git] / src / runtime / interrupt.c
index a266301..cb85bee 100644 (file)
@@ -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