Primarily technical blog on Lisp, .NET, C# development.

Friday, April 9, 2010

Save Lisp and Die

If you are running SBCL and are using threads, this is the way I found out that works for me to stop the threads before saving the core.

(dolist (thread (sb-thread:list-all-threads))
    (unless (eq thread sb-thread:*current-thread*)
      (sb-thread:terminate-thread thread)))
 
then you can run...

(sb-ext:save-lisp-and-die "core-file")
 
I am using SBCL 1.0.36 64bit on a Linux Ubuntu 9.10 64bit.

No comments: