- (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)))))))