Skip to content
Snippets Groups Projects
Commit c8548a94 authored by Samuel Edwin Ward's avatar Samuel Edwin Ward
Browse files

Bug fix: FORCE no longer tries to stop computation if it has not started

parent 298c7c47
No related branches found
No related tags found
No related merge requests found
......@@ -31,7 +31,7 @@ computation of the future)."
(return-from force nil)
(setf (%values future) values)))
(with-slots (computing-thread) future
(unless (eq computing-thread (current-thread))
(unless (or (null computing-thread) (eq computing-thread (current-thread)))
(abort-scheduled-future-task computing-thread (future-id future)))
(dolist (x (wait-list future))
(with-lock-held ((car x))
......
......@@ -75,6 +75,12 @@
(sleep 0.2)
(and flag (yield foo))))))
(test force-unstarted
(is (= 1
(let ((future (pcall (constantly 5) :lazy)))
(force future 1)
(yield future)))))
(test gc-future
(is (= 1
(let ((foo 1))
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment