threads, io.streams.c: cleanups

db4
Slava Pestov 2009-12-15 07:20:41 -05:00
parent 0068bce934
commit f6c0c64518
2 changed files with 7 additions and 2 deletions

View File

@ -140,7 +140,11 @@ DEFER: next
!
! And if sleep-time outputs f, there are no sleeping
! threads either... so WTF.
sleep-time [ die 0 ] unless* (sleep) next ;
sleep-time {
{ [ dup not ] [ drop die ] }
{ [ dup 0 = ] [ drop ] }
[ (sleep) ]
} cond next ;
: (next) ( arg thread -- * )
f >>state

View File

@ -73,7 +73,8 @@ M: c-io-backend init-io ;
M: c-io-backend init-stdio init-c-stdio ;
M: c-io-backend io-multiplex 60 60 * 1000 * 1000 * or (sleep) ;
M: c-io-backend io-multiplex
dup 0 = [ drop ] [ 60 60 * 1000 * 1000 * or (sleep) ] if ;
: fopen ( path mode -- alien )
[ utf8 string>alien ] bi@ (fopen) ;