1 ! Copyright (C) 2008 Slava Pestov.
\r
2 ! See http://factorcode.org/license.txt for BSD license.
\r
3 USING: threads io.backend namespaces init math kernel ;
\r
6 ! The Cocoa UI backend stops the I/O thread and takes over
\r
8 SYMBOL: io-thread-running?
\r
11 sleep-time io-multiplex yield ;
\r
13 : start-io-thread ( -- )
\r
14 [ [ io-thread-running? get-global ] [ io-thread ] while ]
\r
15 "I/O wait" spawn drop ;
\r
18 t io-thread-running? set-global
\r
20 ] "io.thread" add-init-hook
\r