io.monitors.recursive: fix hang introduced by recent io.monitors change
parent
cc5394f4e9
commit
5336d6f287
|
@ -39,17 +39,19 @@ DEFER: add-child-monitor
|
||||||
: remove-child-monitor ( monitor -- )
|
: remove-child-monitor ( monitor -- )
|
||||||
monitor tget children>> delete-at* [ dispose ] [ drop ] if ;
|
monitor tget children>> delete-at* [ dispose ] [ drop ] if ;
|
||||||
|
|
||||||
|
SYMBOL: +stop+
|
||||||
|
|
||||||
M: recursive-monitor dispose*
|
M: recursive-monitor dispose*
|
||||||
[ "stop" swap thread>> send-synchronous drop ]
|
[ [ +stop+ ] dip thread>> send ] [ call-next-method ] bi ;
|
||||||
[ call-next-method ]
|
|
||||||
bi ;
|
|
||||||
|
|
||||||
: stop-pump ( -- )
|
: stop-pump ( -- )
|
||||||
monitor tget children>> values dispose-each ;
|
monitor tget children>> values dispose-each ;
|
||||||
|
|
||||||
: pump-step ( msg -- )
|
: pump-step ( msg -- )
|
||||||
|
monitor tget disposed>> [ drop ] [
|
||||||
[ [ monitor>> path>> ] [ path>> ] bi append-path ] [ changed>> ] bi
|
[ [ monitor>> path>> ] [ path>> ] bi append-path ] [ changed>> ] bi
|
||||||
monitor tget queue-change ;
|
monitor tget queue-change
|
||||||
|
] if ;
|
||||||
|
|
||||||
: child-added ( path monitor -- )
|
: child-added ( path monitor -- )
|
||||||
path>> prepend-path add-child-monitor ;
|
path>> prepend-path add-child-monitor ;
|
||||||
|
@ -69,8 +71,8 @@ M: recursive-monitor dispose*
|
||||||
] with with each ;
|
] with with each ;
|
||||||
|
|
||||||
: pump-loop ( -- )
|
: pump-loop ( -- )
|
||||||
receive dup synchronous? [
|
receive dup +stop+ eq? [
|
||||||
[ stop-pump t ] dip reply-synchronous
|
drop stop-pump
|
||||||
] [
|
] [
|
||||||
[ '[ _ update-hierarchy ] ignore-errors ] [ pump-step ] bi
|
[ '[ _ update-hierarchy ] ignore-errors ] [ pump-step ] bi
|
||||||
pump-loop
|
pump-loop
|
||||||
|
|
Loading…
Reference in New Issue