yield changes
parent
c15c1e3dd8
commit
b679c73096
|
@ -9,7 +9,6 @@
|
|||
- get all-tests to run with -no-compile
|
||||
- if external factor is down, don't add tons of random shit to the dictionary
|
||||
- scalar * matrix, vector * matrix, matrix * vector need to work
|
||||
- turning vectors into row and column matrices
|
||||
- make-matrix is slow and ugly
|
||||
- move 2repeat somewhere else
|
||||
- rotating cube demo
|
||||
|
|
|
@ -19,13 +19,13 @@ namespaces ;
|
|||
deque set-run-queue
|
||||
] ifte ;
|
||||
|
||||
: schedule-thread ( quot -- ) run-queue enque set-run-queue ;
|
||||
: schedule-thread ( quot -- )
|
||||
run-queue enque set-run-queue ;
|
||||
|
||||
: stop ( -- )
|
||||
#! If there is a quotation in the run queue, call it,
|
||||
#! otherwise wait for I/O.
|
||||
pending-io? [ 10 io-multiplex ] when
|
||||
next-thread [ call ] [ -1 io-multiplex stop ] ifte* ;
|
||||
! This definition gets replaced by the Unix and Win32 I/O
|
||||
! code.
|
||||
next-thread [ call ] [ "No more tasks" throw ] ifte* ;
|
||||
|
||||
: yield ( -- )
|
||||
#! Add the current continuation to the run queue, and yield
|
||||
|
|
|
@ -388,3 +388,11 @@ USE: stdio
|
|||
IN: streams
|
||||
|
||||
: fcopy 2drop ;
|
||||
|
||||
IN: threads
|
||||
|
||||
: stop ( -- )
|
||||
#! If there is a quotation in the run queue, call it,
|
||||
#! otherwise wait for I/O.
|
||||
pending-io? [ 10 io-multiplex ] when
|
||||
next-thread [ call ] [ -1 io-multiplex stop ] ifte* ;
|
||||
|
|
Loading…
Reference in New Issue