Last active

Embed URL

HTTPS clone URL

SSH clone URL

You can clone with HTTPS or SSH.

Download Gist

sbcl won't finalize until the thread is done?

View gist:7832108
1 2 3 4 5 6 7 8 9 10 11
(defclass finalize-test () ())
 
(defmethod initialize-instance ((instance finalize-test) &key &allow-other-keys)
(bt:make-thread (lambda () (sleep 300)))
(tg:finalize instance
(lambda ()
(format t "I am all done.~%"))))
 
(make-instance 'finalize-test)
 
(cl-user::gc :full t)
View gist:7832108
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16
;; Same problem:
 
(defclass finalize-test () ())
 
(defun make-my-thread ()
(bt:make-thread (lambda () (sleep 300))))
 
(defmethod initialize-instance ((instance finalize-test) &key &allow-other-keys)
(make-my-thread)
(tg:finalize instance
(lambda ()
(format t "I am all done.~%"))))
 
(make-instance 'finalize-test)
 
(cl-user::gc :full t)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.