diff --git a/future.lisp b/future.lisp index f79286b2cb57ee469b3348eff6e5d2729bf9e149..0f7b25be12932d1f371b1068a2fe6bc78d828d14 100644 --- a/future.lisp +++ b/future.lisp @@ -53,7 +53,7 @@ computation of the future)." (with-lock-held ((lock future)) (when (%ready-to-yield? future) (return-from select future)) - (when (and (not any-computing?) (computing-thread future)) + (when (computing-thread future) (setf any-computing? t)) (push (cons select-lock notifier) (wait-list future)))) (unless any-computing? diff --git a/make-future.lisp b/make-future.lisp index e95e34b31e48211397e375e31ab253fa0e2346e8..7a22f717112fd5fb4c3ab4c4eaa8a1dacc83360f 100644 --- a/make-future.lisp +++ b/make-future.lisp @@ -22,7 +22,7 @@ If lazy, newly created futures are not computed until asked to yield their value (flet ((get-future () (or (weak-pointer-value future-ptr) (throw 'task-done nil)))) (let ((*computing-future* (future-id (get-future)))) (with-lock-held ((lock (get-future))) - (if (%ready-to-yield? (get-future)) + (if (or (%ready-to-yield? (get-future)) (computing-thread (get-future))) (throw 'task-done nil) (setf (computing-thread (get-future)) (current-thread)))) (finalize (get-future) (let ((thread (current-thread))