1.0.25.51: use WITH-RECURSIVE-SYSTEM-SPINLOCK
[sbcl.git] / src / runtime / bsd-os.c
index a364d5a..3d06aa3 100644 (file)
@@ -222,10 +222,20 @@ memory_fault_handler(int signal, siginfo_t *siginfo, void *void_context
 #ifdef LISP_FEATURE_C_STACK_IS_CONTROL_STACK
             lisp_memory_fault_error(context, fault_addr);
 #else
+
+            /* this disabled section is what used to be here: */
+#if 0
+            /* FIXME: never returns 0 */
             if (!maybe_gc(context)) {
                 interrupt_handle_now(signal, siginfo, context);
             }
 #endif
+            /* FIXME: Nowadays, maybe_gc does return 1 to indicate
+             * that GC did happen, but I'm keeping the code as it
+             * was. */
+            maybe_gc(context);
+            interrupt_handle_now(signal, siginfo, context);
+#endif
         }
 }
 
@@ -252,14 +262,8 @@ os_install_interrupt_handlers(void)
 #endif
 
 #ifdef LISP_FEATURE_SB_THREAD
-    undoably_install_low_level_interrupt_handler(SIG_INTERRUPT_THREAD,
-                                                 interrupt_thread_handler);
     undoably_install_low_level_interrupt_handler(SIG_STOP_FOR_GC,
                                                  sig_stop_for_gc_handler);
-#ifdef SIG_RESUME_FROM_GC
-    undoably_install_low_level_interrupt_handler(SIG_RESUME_FROM_GC,
-                                                 sig_stop_for_gc_handler);
-#endif
 #endif
     SHOW("leaving os_install_interrupt_handlers()");
 }
@@ -410,7 +414,6 @@ futex_wait(int *lock_word, long oldval, long sec, unsigned long usec)
     struct timespec timeout;
     int ret;
 
-again:
     if (sec < 0)
         ret = umtx_wait((void *)lock_word, oldval, NULL);
     else {
@@ -425,8 +428,7 @@ again:
     case ETIMEDOUT:
         return 1;
     case EINTR:
-        /* spurious wakeup from interrupt */
-        goto again;
+        return 2;
     default:
         /* EWOULDBLOCK and others, need to check the lock */
         return -1;