disassemble: New customization variable sb-ext:*disassemble-annotate*.
[sbcl.git] / src / code / toplevel.lisp
index 9fa8189..f3f226b 100644 (file)
@@ -30,6 +30,7 @@
                   *allow-with-interrupts*
                   *interrupts-enabled*
                   *interrupt-pending*
+                  #!+sb-thruption *thruption-pending*
                   *type-system-initialized*))
 
 (defvar *cold-init-complete-p*)
@@ -107,13 +108,18 @@ means to wait indefinitely.")
 (defun %exit ()
   ;; If anything goes wrong, we will exit immediately and forcibly.
   (handler-bind ((serious-condition *exit-error-handler*))
-    (let (ok)
-      (unwind-protect
-           (progn
-             (flush-standard-output-streams)
-             (sb!thread::%exit-other-threads)
-             (setf ok t))
-        (os-exit *exit-in-process* :abort (not ok))))))
+    (let ((ok nil)
+          (code *exit-in-process*))
+      (if (consp code)
+          ;; Another thread called EXIT, and passed the buck to us -- only
+          ;; final call left to do.
+          (os-exit (car code) :abort nil)
+          (unwind-protect
+               (progn
+                 (flush-standard-output-streams)
+                 (sb!thread::%exit-other-threads)
+                 (setf ok t))
+            (os-exit code :abort (not ok)))))))
 \f
 ;;;; working with *CURRENT-ERROR-DEPTH* and *MAXIMUM-ERROR-DEPTH*