cl-user> (defvar *my-thread-specific-special* 33)
*my-thread-specific-special*
cl-user> (defvar *thread-result* '())
*thread-result*
cl-user> (let ((thread (bt:make-thread (lambda () (loop repeat 3 do (sleep 1) (print (push *my-thread-specific-special* *thread-result*))))
:initial-bindings '((*my-thread-specific-special* . 42)))))
(setf *my-thread-specific-special* 0
*thread-result* '())
(unwind-protect
(loop repeat 3 do (incf *my-thread-specific-special*) (sleep 1))
(bt:destroy-thread thread))
(values *my-thread-specific-special* *thread-result*))
3
(42 42 42)
cl-user>
I would expect the same in lispworks…
--
__Pascal J. Bourguignon__