From 1a6f6335df30cf11599c7f609b8716cebe3b04a0 Mon Sep 17 00:00:00 2001 From: Sean Whitton Date: Fri, 1 Apr 2022 23:52:37 -0700 Subject: EVAL-IN-{GRANDCHILD,REINVOKED}: convert from macros to functions Signed-off-by: Sean Whitton --- src/connection/fork.lisp | 42 ++++++++++++++++++++++-------------------- 1 file changed, 22 insertions(+), 20 deletions(-) (limited to 'src/connection') diff --git a/src/connection/fork.lisp b/src/connection/fork.lisp index 2958a04..ca269df 100644 --- a/src/connection/fork.lisp +++ b/src/connection/fork.lisp @@ -26,8 +26,9 @@ Must not start up any threads.")) (defmethod continue-connection ((connection fork-connection) remaining) - (eval-in-grandchild `(post-fork ,connection) - `(continue-deploy* ,connection ',remaining) (out err exit) + (multiple-value-bind (out err exit) + (eval-in-grandchild `(post-fork ,connection) + `(continue-deploy* ,connection ',remaining)) (when-let ((lines (lines out))) (inform t lines)) (return-exit @@ -59,24 +60,25 @@ single-threaded context for the execution of POST-FORK.")) #+sbcl (defmethod continue-connection ((connection init-hooks-connection) remaining) - (eval-in-reinvoked - `(push - (lambda () - (handler-bind - ((serious-condition - (lambda (c) - (trivial-backtrace:print-backtrace c :output *error-output*) - (uiop:quit 1)))) - ;; Handle the finaliser thread in older SBCL, before the change in - ;; 2.1.8 to call *INIT-HOOKS* before starting system threads. - #+consfigurator.connection.fork::older-sbcl - (sb-int:with-system-mutex (sb-thread::*make-thread-lock*) - (sb-impl::finalizer-thread-stop)) - (post-fork ,connection) - #+consfigurator.connection.fork::older-sbcl - (sb-impl::finalizer-thread-start))) - sb-ext:*init-hooks*) - `(continue-deploy* ,connection ',remaining) (out err exit) + (multiple-value-bind (out err exit) + (eval-in-reinvoked + `(push + (lambda () + (handler-bind + ((serious-condition + (lambda (c) + (trivial-backtrace:print-backtrace c :output *error-output*) + (uiop:quit 1)))) + ;; Handle the finaliser thread in older SBCL, before the change in + ;; 2.1.8 to call *INIT-HOOKS* before starting system threads. + #+consfigurator.connection.fork::older-sbcl + (sb-int:with-system-mutex (sb-thread::*make-thread-lock*) + (sb-impl::finalizer-thread-stop)) + (post-fork ,connection) + #+consfigurator.connection.fork::older-sbcl + (sb-impl::finalizer-thread-start))) + sb-ext:*init-hooks*) + `(continue-deploy* ,connection ',remaining)) (when-let ((lines (lines out))) (inform t lines)) (return-exit -- cgit v1.2.3