Fix erg's bug
parent
1bb4763927
commit
e61ef195b6
|
@ -41,3 +41,5 @@ yield
|
||||||
] ;
|
] ;
|
||||||
|
|
||||||
[ t ] [ spawn-namespace-test ] unit-test
|
[ t ] [ spawn-namespace-test ] unit-test
|
||||||
|
|
||||||
|
[ "a" [ 1 1 + ] spawn 100 sleep ] must-fail
|
||||||
|
|
|
@ -4,16 +4,22 @@
|
||||||
USING: arrays hashtables heaps kernel kernel.private math
|
USING: arrays hashtables heaps kernel kernel.private math
|
||||||
namespaces sequences vectors continuations continuations.private
|
namespaces sequences vectors continuations continuations.private
|
||||||
dlists assocs system combinators init boxes accessors
|
dlists assocs system combinators init boxes accessors
|
||||||
math.order dequeues ;
|
math.order dequeues strings quotations ;
|
||||||
IN: threads
|
IN: threads
|
||||||
|
|
||||||
SYMBOL: initial-thread
|
SYMBOL: initial-thread
|
||||||
|
|
||||||
TUPLE: thread
|
TUPLE: thread
|
||||||
name quot exit-handler
|
{ name string }
|
||||||
id
|
{ quot callable initial: [ ] }
|
||||||
continuation state runnable
|
{ exit-handler callable initial: [ ] }
|
||||||
mailbox variables sleep-entry ;
|
{ id integer }
|
||||||
|
continuation
|
||||||
|
state
|
||||||
|
runnable
|
||||||
|
mailbox
|
||||||
|
variables
|
||||||
|
sleep-entry ;
|
||||||
|
|
||||||
: self ( -- thread ) 63 getenv ; inline
|
: self ( -- thread ) 63 getenv ; inline
|
||||||
|
|
||||||
|
@ -62,8 +68,7 @@ PRIVATE>
|
||||||
swap >>name
|
swap >>name
|
||||||
swap >>quot
|
swap >>quot
|
||||||
\ thread counter >>id
|
\ thread counter >>id
|
||||||
<box> >>continuation
|
<box> >>continuation ; inline
|
||||||
[ ] >>exit-handler ; inline
|
|
||||||
|
|
||||||
: <thread> ( quot name -- thread )
|
: <thread> ( quot name -- thread )
|
||||||
\ thread new-thread ;
|
\ thread new-thread ;
|
||||||
|
@ -211,7 +216,7 @@ GENERIC: error-in-thread ( error thread -- )
|
||||||
<dlist> 65 setenv
|
<dlist> 65 setenv
|
||||||
<min-heap> 66 setenv
|
<min-heap> 66 setenv
|
||||||
initial-thread global
|
initial-thread global
|
||||||
[ drop f "Initial" <thread> ] cache
|
[ drop [ ] "Initial" <thread> ] cache
|
||||||
<box> >>continuation
|
<box> >>continuation
|
||||||
t >>runnable
|
t >>runnable
|
||||||
f >>state
|
f >>state
|
||||||
|
|
Loading…
Reference in New Issue