Fix problem with walker threads hanging around

db4
Slava Pestov 2008-05-30 19:49:57 -05:00
parent 73a06ed9b0
commit 5663707cda
1 changed files with 4 additions and 7 deletions
extra/tools/walker

View File

@ -4,7 +4,7 @@ USING: threads kernel namespaces continuations combinators
sequences math namespaces.private continuations.private
concurrency.messaging quotations kernel.private words
sequences.private assocs models arrays accessors
generic generic.standard ;
generic generic.standard definitions ;
IN: tools.walker
SYMBOL: show-walker-hook ! ( status continuation thread -- )
@ -73,6 +73,7 @@ M: object add-breakpoint ;
{ [ dup "step-into" word-prop ] [ "step-into" word-prop call ] }
{ [ dup standard-generic? ] [ effective-method (step-into-execute) ] }
{ [ dup hook-generic? ] [ effective-method (step-into-execute) ] }
{ [ dup uses \ suspend swap member? ] [ execute break ] }
{ [ dup primitive? ] [ execute break ] }
[ word-def (step-into-quot) ]
} cond ;
@ -89,7 +90,6 @@ SYMBOL: step-into
SYMBOL: step-all
SYMBOL: step-into-all
SYMBOL: step-back
SYMBOL: detach
SYMBOL: abandon
SYMBOL: call-in
@ -137,7 +137,7 @@ SYMBOL: +stopped+
{
>n ndrop >c c>
continue continue-with
stop yield suspend sleep (spawn)
stop suspend (spawn)
} [
dup [ execute break ] curry
"step-into" set-word-prop
@ -168,10 +168,7 @@ SYMBOL: +stopped+
+running+ set-status ;
: walker-stopped ( -- )
+stopped+ set-status
[ status +stopped+ eq? ]
[ [ drop f ] handle-synchronous ]
[ ] while ;
+stopped+ set-status ;
: step-into-all-loop ( -- )
+running+ set-status