Use safepoints for INTERRUPT-THREAD
[sbcl.git] / src / runtime / sunos-os.c
index 4389564..c1925ed 100644 (file)
@@ -138,6 +138,11 @@ sigsegv_handler(int signal, siginfo_t *info, os_context_t *context)
 {
     void* fault_addr = (void*)info->si_addr;
 
+#ifdef LISP_FEATURE_SB_SAFEPOINT
+    if (handle_safepoint_violation(context, fault_addr))
+            return;
+#endif
+
     if (!gencgc_handle_wp_violation(fault_addr))
         if(!handle_guard_page_triggered(context, fault_addr))
             lisp_memory_fault_error(context, fault_addr);
@@ -164,9 +169,17 @@ os_install_interrupt_handlers()
     undoably_install_low_level_interrupt_handler(SIG_MEMORY_FAULT,
                                                  sigsegv_handler);
 
+    /* OAOOM c.f. linux-os.c.
+     * Should we have a reusable function gc_install_interrupt_handlers? */
 #ifdef LISP_FEATURE_SB_THREAD
+# ifdef LISP_FEATURE_SB_SAFEPOINT
+#  ifdef LISP_FEATURE_SB_THRUPTION
+    undoably_install_low_level_interrupt_handler(SIGPIPE, thruption_handler);
+#  endif
+# else
     undoably_install_low_level_interrupt_handler(SIG_STOP_FOR_GC,
                                                  sig_stop_for_gc_handler);
+# endif
 #endif
 }