]> gitweb.factorcode.org Git - factor.git/commitdiff
threads, io.streams.c: cleanups
authorSlava Pestov <slava@slava-pestovs-macbook-pro.local>
Tue, 15 Dec 2009 12:20:41 +0000 (07:20 -0500)
committerSlava Pestov <slava@slava-pestovs-macbook-pro.local>
Tue, 15 Dec 2009 12:20:41 +0000 (07:20 -0500)
basis/threads/threads.factor
core/io/streams/c/c.factor

index af11d77f8458e89bc9090f99b5288c32317e2c17..9d1cd29337665b60434c6e1979965b2619a45a92 100644 (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
index 1da30fe922c3e12e49004a6660090b5f65194c13..cb978d5debb6589b0adaea3f65a54a56aa8ac726 100644 (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) ;