being still a bloody noob, i'm experimenting, trying this and that, just in order to get a feeling for the language. i use every means i can find on the web, but today i've been running into a trap of which no escape seems available. consider this simple script:
Code: Select all
(push "/root/clbuild/systems/" asdf:*central-registry*)
(asdf:operate 'asdf:load-op :bordeaux-threads)
(defun in-thread (a)
(let ((b 0)
(lock (bordeaux-threads:make-lock)))
(loop while (= 1 1) do
(setq b (+ b 1))
(setq a (+ a 1))
(bordeaux-threads:acquire-lock lock t)
(print a)
(bordeaux-threads:release-lock lock)
(if (= b 10) (return 0))
)))
(bordeaux-threads:make-thread (in-thread 0) :name 't-1)
(bordeaux-threads:make-thread (in-thread 10) :name 't-2)
(bordeaux-threads:make-thread (in-thread 100) :name 't-3)