Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Loading…

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

Merged
merged 2 commits into from

2 participants

@StrmSrfr

Previously SBCL would produce "The value NIL is not of type SB-THREAD:THREAD" errors when calling FORCE on a future that has not started computing. This fixes that.

@vsedach
Owner

Thank you for the bug fix!

@vsedach vsedach merged commit 42c43f9 into vsedach:master
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Nov 16, 2011
  1. @StrmSrfr
Commits on Feb 21, 2013
  1. Merge remote branch 'upstream/master'

    Samuel Edwin Ward authored
This page is out of date. Refresh to see the latest.
Showing with 7 additions and 1 deletion.
  1. +1 −1  future.lisp
  2. +6 −0 test/test.lisp
View
2  future.lisp
@@ -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))
View
6 test/test.lisp
@@ -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))
Something went wrong with that request. Please try again.