From 3a90db03c6634f899b4d24d32b67cef808a22353 Mon Sep 17 00:00:00 2001 From: Doug Coleman Date: Sat, 21 Nov 2009 20:56:39 -0600 Subject: [PATCH 1/2] use CONSTANT: in epoll --- basis/io/backend/unix/multiplexers/epoll/epoll.factor | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/basis/io/backend/unix/multiplexers/epoll/epoll.factor b/basis/io/backend/unix/multiplexers/epoll/epoll.factor index 3985729935..6ec8caaad8 100644 --- a/basis/io/backend/unix/multiplexers/epoll/epoll.factor +++ b/basis/io/backend/unix/multiplexers/epoll/epoll.factor @@ -9,10 +9,9 @@ IN: io.backend.unix.multiplexers.epoll TUPLE: epoll-mx < mx events ; -: max-events ( -- n ) - #! We read up to 256 events at a time. This is an arbitrary - #! constant... - 256 ; inline +#! We read up to 256 events at a time. This is an arbitrary +#! constant... +CONSTANT: max-events 256 : ( -- mx ) epoll-mx new-mx From c222e5b6b1e27772abf12fed3583169b0c4354d1 Mon Sep 17 00:00:00 2001 From: Slava Pestov Date: Sun, 22 Nov 2009 13:49:10 -0600 Subject: [PATCH 2/2] io.launcher.unix: tests don't hang on failure --- basis/io/launcher/unix/unix-tests.factor | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/basis/io/launcher/unix/unix-tests.factor b/basis/io/launcher/unix/unix-tests.factor index 7fa7f4b2c6..4304f5f62a 100644 --- a/basis/io/launcher/unix/unix-tests.factor +++ b/basis/io/launcher/unix/unix-tests.factor @@ -3,7 +3,7 @@ USING: io.files io.files.temp io.directories io.pathnames tools.test io.launcher arrays io namespaces continuations math io.encodings.binary io.encodings.ascii accessors kernel sequences io.encodings.utf8 destructors io.streams.duplex locals -concurrency.promises threads unix.process ; +concurrency.promises threads unix.process calendar ; [ ] [ [ "launcher-test-1" temp-file delete-file ] ignore-errors @@ -128,12 +128,13 @@ concurrency.promises threads unix.process ; [let :> p :> s + [ "sleep 1000" run-detached [ p fulfill ] [ wait-for-process s fulfill ] bi ] in-thread - p ?promise handle>> 9 kill drop + p 1 seconds ?promise-timeout handle>> 9 kill drop s ?promise 0 = ] ] unit-test