Last active
December 30, 2015 12:49
-
-
Save rpav/7832108 to your computer and use it in GitHub Desktop.
sbcl won't finalize until the thread is done?
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(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) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
;; 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