Form to run when process terminates.
The process to watch for termination. By default, this is the value of *current-process*.
Ensures that the
cleanup-form
is present for the given process. When the process terminates, its cleanup forms are run. Cleanup forms can be functions of one argument (the process), or lists, in which case the
car
is applied to the process and the
cdr
of the list.
When adding cleanup forms, this function uses
equal
to ensure that the form is only added once.
You can test for whether the current process is executing its cleanups with current-process-in-cleanup-p.
A process calls
add-process-dependent
each time a dependent object is added to a process. When the process terminates,
inform-dependent-of-dead-process
is called on all dependent objects.
(defun add-process-dependent (dependent)
(mp:ensure-process-cleanup
`(delete-process-dependent ,dependent)))
(defun delete-process-dependent (process dependent)
(inform-dependent-of-dead-process dependent process))
LispWorks User Guide and Reference Manual - 21 Dec 2011