ui: try and ensure that the ui thread finishes #1905
parent
dd36f6ad57
commit
62542c52a9
|
@ -0,0 +1,9 @@
|
||||||
|
USING: assocs kernel threads tools.test ui ;
|
||||||
|
IN: ui.tests
|
||||||
|
|
||||||
|
{ t } [
|
||||||
|
! with-ui shouldn't leave any thread hanging around.
|
||||||
|
threads assoc-size
|
||||||
|
[ ] with-ui
|
||||||
|
threads assoc-size =
|
||||||
|
] unit-test
|
|
@ -224,7 +224,11 @@ M: object resize-window 2drop ;
|
||||||
ui-running? [ call( -- ) ] [
|
ui-running? [ call( -- ) ] [
|
||||||
t ui-running set-global '[
|
t ui-running set-global '[
|
||||||
[ init-ui @ ] (with-ui)
|
[ init-ui @ ] (with-ui)
|
||||||
] [ f ui-running set-global ] [ ] cleanup
|
] [
|
||||||
|
f ui-running set-global
|
||||||
|
! Give running ui threads a chance to finish.
|
||||||
|
notify-ui-thread yield
|
||||||
|
] [ ] cleanup
|
||||||
] if ;
|
] if ;
|
||||||
|
|
||||||
HOOK: beep ui-backend ( -- )
|
HOOK: beep ui-backend ( -- )
|
||||||
|
|
Loading…
Reference in New Issue