io.thread: if the I/O thread throws an error, call out to the fep immediately instead of going through the normal thread error mechanism, which by that point won't work anyway
parent
01eeabbcbd
commit
dfc7326413
|
@ -7,13 +7,22 @@ IN: io.thread
|
||||||
! over completely.
|
! over completely.
|
||||||
SYMBOL: io-thread-running?
|
SYMBOL: io-thread-running?
|
||||||
|
|
||||||
: io-thread ( -- )
|
TUPLE: io-thread < thread ;
|
||||||
sleep-time io-multiplex yield ;
|
|
||||||
|
: <io-thread> ( -- thread )
|
||||||
|
[
|
||||||
|
[ io-thread-running? get-global ]
|
||||||
|
[ sleep-time io-multiplex yield ]
|
||||||
|
while
|
||||||
|
]
|
||||||
|
"I/O wait"
|
||||||
|
io-thread new-thread ;
|
||||||
|
|
||||||
|
M: io-thread error-in-thread [ die ] call( error thread -- ) ;
|
||||||
|
|
||||||
: start-io-thread ( -- )
|
: start-io-thread ( -- )
|
||||||
t io-thread-running? set-global
|
t io-thread-running? set-global
|
||||||
[ [ io-thread-running? get-global ] [ io-thread ] while ]
|
<io-thread> (spawn) ;
|
||||||
"I/O wait" spawn drop ;
|
|
||||||
|
|
||||||
: stop-io-thread ( -- )
|
: stop-io-thread ( -- )
|
||||||
f io-thread-running? set-global ;
|
f io-thread-running? set-global ;
|
||||||
|
|
Loading…
Reference in New Issue