1.0.41.21: runtime: Current stack and frame pointers are per-thread data.
[sbcl.git] / src / runtime / alloc.c
index 500bfb0..58c1798 100644 (file)
@@ -40,11 +40,10 @@ 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();
+    /* SIG_STOP_FOR_GC must be unblocked: else two threads racing here
+     * may deadlock: one will wait on the GC lock, and the other
+     * cannot stop the first one... */
+    check_gc_signals_unblocked_or_lose(0);
 
     /* FIXME: OOAO violation: see arch_pseudo_* */
     set_pseudo_atomic_atomic(th);
@@ -74,13 +73,13 @@ pa_alloc(int bytes, int page_type_flag)
 #ifdef LISP_FEATURE_STACK_GROWS_DOWNWARD_NOT_UPWARD
 #error "!C_STACK_IS_CONTROL_STACK and STACK_GROWS_DOWNWARD_NOT_UPWARD is not supported"
 #endif
-        *current_control_stack_pointer = (lispobj) result;
-        current_control_stack_pointer += 1;
+        *access_control_stack_pointer(th) = (lispobj) result;
+        access_control_stack_pointer(th) += 1;
 #endif
         do_pending_interrupt();
 #ifndef LISP_FEATURE_C_STACK_IS_CONTROL_STACK
-        current_control_stack_pointer -= 1;
-        result = (lispobj *) *current_control_stack_pointer;
+        access_control_stack_pointer(th) -= 1;
+        result = (lispobj *) *access_control_stack_pointer(th);
 #endif
     }
     return result;
@@ -94,7 +93,7 @@ pa_alloc(int bytes, int page_type_flag)
     /* This is not pseudo atomic at all, but is called only from
      * interrupt safe places like interrupt handlers. MG -
      * 2005-08-09 */
-    check_deferrables_blocked_or_lose();
+    check_deferrables_blocked_or_lose(0);
 
     result = dynamic_space_free_pointer;