1.0.25.52: go through lisp_memory_fault_error on all platforms
[sbcl.git] / src / runtime / alloc.c
index 19518e4..dc4f5f2 100644 (file)
@@ -40,8 +40,13 @@ pa_alloc(int bytes, int page_type_flag)
     lispobj *result;
     struct thread *th = arch_os_get_current_thread();
 
+    /* SIG_STOP_FOR_GC needs to be enabled before we can call lisp:
+     * otherwise two threads racing here may deadlock: the other will
+     * wait on the GC lock, and the other cannot stop the first
+     * one... */
+    check_gc_signals_unblocked_or_lose();
+
     /* FIXME: OOAO violation: see arch_pseudo_* */
-    clear_pseudo_atomic_interrupted(th);
     set_pseudo_atomic_atomic(th);
     result = general_alloc(bytes, page_type_flag);
 #if 0