calendar: make it deploy with threads disabled

db4
Slava Pestov 2011-02-27 13:55:02 -08:00
parent 979e487fef
commit 779468f5a0
2 changed files with 10 additions and 4 deletions

View File

@ -2,7 +2,7 @@
! See http://factorcode.org/license.txt for BSD license. ! See http://factorcode.org/license.txt for BSD license.
USING: accessors arrays classes.tuple combinators USING: accessors arrays classes.tuple combinators
combinators.short-circuit kernel locals math math.functions combinators.short-circuit kernel locals math math.functions
math.order sequences summary system threads vocabs.loader ; math.order sequences summary system vocabs.loader ;
IN: calendar IN: calendar
HOOK: gmt-offset os ( -- hours minutes seconds ) HOOK: gmt-offset os ( -- hours minutes seconds )
@ -540,10 +540,9 @@ M: integer end-of-year 12 31 <date> ;
: unix-time>timestamp ( seconds -- timestamp ) : unix-time>timestamp ( seconds -- timestamp )
seconds unix-1970 time+ ; seconds unix-1970 time+ ;
M: duration sleep
duration>nanoseconds >integer nano-count + sleep-until ;
{ {
{ [ os unix? ] [ "calendar.unix" ] } { [ os unix? ] [ "calendar.unix" ] }
{ [ os windows? ] [ "calendar.windows" ] } { [ os windows? ] [ "calendar.windows" ] }
} cond require } cond require
{ "threads" "calendar" } "calendar.threads" require-when

View File

@ -0,0 +1,7 @@
! Copyright (C) 2011 Slava Pestov.
! See http://factorcode.org/license.txt for BSD license.
USING: calendar math system threads ;
IN: calendar.threads
M: duration sleep
duration>nanoseconds >integer nano-count + sleep-until ;