diff --git a/basis/calendar/calendar.factor b/basis/calendar/calendar.factor index 4e6b35161f..85a1c72d11 100644 --- a/basis/calendar/calendar.factor +++ b/basis/calendar/calendar.factor @@ -2,7 +2,7 @@ ! See http://factorcode.org/license.txt for BSD license. USING: accessors arrays classes.tuple combinators 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 HOOK: gmt-offset os ( -- hours minutes seconds ) @@ -540,10 +540,9 @@ M: integer end-of-year 12 31 ; : unix-time>timestamp ( seconds -- timestamp ) seconds unix-1970 time+ ; -M: duration sleep - duration>nanoseconds >integer nano-count + sleep-until ; - { { [ os unix? ] [ "calendar.unix" ] } { [ os windows? ] [ "calendar.windows" ] } } cond require + +{ "threads" "calendar" } "calendar.threads" require-when diff --git a/basis/calendar/threads/threads.factor b/basis/calendar/threads/threads.factor new file mode 100644 index 0000000000..efdbb6923d --- /dev/null +++ b/basis/calendar/threads/threads.factor @@ -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 ;