[slime-devel] Shutting down Swank within an Image.

Andrew Myers asm198 at gmail.com
Fri Nov 4 17:26:06 UTC 2011


I'm not aware of a way to do this portably but if there is a way I
would be happy to learn. :)

Andrew

On Fri, Nov 4, 2011 at 12:28 PM, Jeffrey Cunningham
<jeffrey at jkcunningham.com> wrote:
> On Fri, 04 Nov 2011 08:54:34 -0700, Andrew Myers <asm198 at gmail.com> wrote:
>
>> I've got an updated version that seems to work quite well:
>>
>> (defun aux-save-image (image-name)
>>  (let ((old-restart excl:*restart-init-function*))
>>    (setf excl:*restart-init-function*
>>          (lambda ()
>>            (dolist (connection swank::*connections*)
>>              (format t "closing ~a~%" connection)
>>              (swank::close-connection connection nil nil))
>>            (when old-restart
>>              (funcall old-restart))))
>>    (excl:dumplisp :name image-name)
>>    (setf excl:*restart-init-function* old-restart)))
>>
>> Is there anything wrong with doing things this way?  I get the same
>> number of threads after I restart an image saved this way (i.e. no
>> left overs from prior runs) and things don't hang.  If this seems like
>> a clean solution I may add a (close-all-swank-connections) method to
>> the swank package and make the swank-backend:save-image implementation
>> for Allegro do something like this.
>>
>> Does this sounds like a valid solution to the problem that other
>> Lispers would be happy with?
>>
>> Andrew
>>
>
>
> Other than being a solution specific to EXCL it looks reasonable.
>




More information about the slime-devel mailing list