Fix another bug with futures

db4
Slava Pestov 2008-02-09 18:12:07 -06:00
parent 0e0a1fb244
commit ef63333980
2 changed files with 8 additions and 3 deletions

View File

@ -134,3 +134,8 @@ SYMBOL: value
[ 3 ] future
dup ?future swap ?future
] unit-test
! Another race
[ 3 ] [
[ 3 yield ] future ?future
] unit-test

View File

@ -273,7 +273,7 @@ TUPLE: future value processes ;
: future ( quot -- future )
#! Spawn a process to call the quotation and immediately return.
\ future construct-empty [
f V{ } clone \ future construct-boa [
[
>r [ t 2array ] compose [ f 2array ] recover r>
notify-future