about summary refs log tree commit diff stats
diff options
context:
space:
mode:
authorKartik K. Agaram <vc@akkartik.com>2015-01-10 13:20:13 -0800
committerKartik K. Agaram <vc@akkartik.com>2015-01-10 13:20:13 -0800
commit9c2ed239561c069beba0953616ddab15ac21265b (patch)
tree0c26cc3d21fa51aa0c72169f42c7bd7323967b84
parentf1737674fc48f5bbfd5a2053fa8e0285c8e67107 (diff)
downloadmu-9c2ed239561c069beba0953616ddab15ac21265b.tar.gz
528
-rw-r--r--mu.arc6
-rw-r--r--mu.arc.t7
2 files changed, 7 insertions, 6 deletions
diff --git a/mu.arc b/mu.arc
index 70d4b534..dcbf5338 100644
--- a/mu.arc
+++ b/mu.arc
@@ -241,12 +241,12 @@
   `((((rep ,routine) 'call-stack) 0) 'results))
 
 (def waiting-for-exact-cycle? (routine)
-  (is 'for-some-cycles rep.routine!sleep.0))
+  (is 'until rep.routine!sleep.0))
 
 (def ready-to-wake-up (routine)
   (assert no.routine*)
   (case rep.routine!sleep.0
-    for-some-cycles
+    until
       (> curr-cycle* rep.routine!sleep.1)
     until-location-changes
       (~is rep.routine!sleep.2 (memory* rep.routine!sleep.1))
@@ -584,7 +584,7 @@
                       for-some-cycles
                         (let wakeup-time (+ curr-cycle* (v arg.1))
                           (trace "run" "sleeping until " wakeup-time)  ; TODO
-                          (= rep.routine*!sleep `(for-some-cycles ,wakeup-time)))
+                          (= rep.routine*!sleep `(until ,wakeup-time)))
                       until-location-changes
                         (= rep.routine*!sleep `(until-location-changes ,(addr arg.1) ,(m arg.1)))
                       ; else
diff --git a/mu.arc.t b/mu.arc.t
index b9ce4dbe..d12b109b 100644
--- a/mu.arc.t
+++ b/mu.arc.t
@@ -2406,7 +2406,7 @@
 (assert (is 1 len.running-routines*))
 ; sleeping routine
 (let routine make-routine!f2
-  (= rep.routine!sleep '(for-some-cycles 23))
+  (= rep.routine!sleep '(until 23))
   (set sleeping-routines*.routine))
 ; not yet time for it to wake up
 (= curr-cycle* 23)
@@ -2431,7 +2431,7 @@
 (assert (is 1 len.running-routines*))
 ; sleeping routine
 (let routine make-routine!f2
-  (= rep.routine!sleep '(for-some-cycles 23))
+  (= rep.routine!sleep '(until 23))
   (set sleeping-routines*.routine))
 ; time for it to wake up
 (= curr-cycle* 24)
@@ -2506,11 +2506,12 @@
 (assert (empty running-routines*))
 ; sleeping routine
 (let routine make-routine!f1
-  (= rep.routine!sleep '(for-some-cycles 34))
+  (= rep.routine!sleep '(until 34))
   (set sleeping-routines*.routine))
 ; long time left for it to wake up
 (= curr-cycle* 0)
 (update-scheduler-state)
+;? (prn curr-cycle*)
 (assert (is curr-cycle* 35))
 (if (~is 1 len.running-routines*)
   (prn "F - scheduler skips ahead to earliest sleeping routines when nothing to run"))