From 779468f5a0998ce087752850bb929b7c505a57e7 Mon Sep 17 00:00:00 2001 From: Slava Pestov Date: Sun, 27 Feb 2011 13:55:02 -0800 Subject: [PATCH] calendar: make it deploy with threads disabled --- basis/calendar/calendar.factor | 7 +++---- basis/calendar/threads/threads.factor | 7 +++++++ 2 files changed, 10 insertions(+), 4 deletions(-) create mode 100644 basis/calendar/threads/threads.factor 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 ;