"Paul Werkowski" <[EMAIL PROTECTED]> writes:
> |
> | Is it possible to THROW from a CMUCL signal handler? The
> | corresponding CATCH is in regular code and I know that it's still in
> | scope when the signal is delivered. When I try this it seems like the
> | THROW is silently ignored.
>
> Please provide an code snippet showing what doesn't work for you.
>
> Paul
>
This works as I had hoped:
;;; +++
(defvar *existing-handler* nil)
(defun reaper (a b &rest c)
(declare (ignore a b c))
(if *existing-handler*
(system:enable-interrupt +SIGCHLD+ *existing-handler*)
(system:default-interrupt +SIGCHLD+))
(throw :fxn-catch :reaped))
(defun fxn ()
(catch :fxn-catch
(setq *existing-handler* (system:enable-interrupt +SIGCHLD+ #'reaper))
(sleep 10)))
;;; ---
FXN returns NIL unless 'sigkill -17 <cmucl-pid>' is issued within 10
seconds, in which case :REAPED is returned.
So I guess it works :)
Thanks,
Derek
--