diff --git a/test/bordeaux-threads-test.lisp b/test/bordeaux-threads-test.lisp index 744d747e5777d03a1c84fdc227defe9be51ec977..94bfb18f0d61d6317b895b8f318dbaaaf26f0d6d 100644 --- a/test/bordeaux-threads-test.lisp +++ b/test/bordeaux-threads-test.lisp @@ -81,8 +81,10 @@ Distributed under the MIT license (see LICENSE file) (return))) (sleep 0.001)))) (let* ((procs (loop - for n from 1 upto 2 - collect (let ((i n)) + for i from 1 upto 2 + ;; create a new binding to protect against implementations that + ;; mutate instead of binding the loop variable + collect (let ((i i)) (make-thread (lambda () (funcall #'worker i)) :name (format nil "Proc #~D" i)))))) @@ -110,6 +112,8 @@ Distributed under the MIT license (see LICENSE file) (condition-notify *condition-variable*))) (let ((num-procs 100)) (dotimes (i num-procs) + ;; create a new binding to protect against implementations that + ;; mutate instead of binding the loop variable (let ((i i)) (make-thread (lambda () (funcall #'worker i))