From 9c2ed239561c069beba0953616ddab15ac21265b Mon Sep 17 00:00:00 2001 From: "Kartik K. Agaram" Date: Sat, 10 Jan 2015 13:20:13 -0800 Subject: 528 --- mu.arc | 6 +++--- mu.arc.t | 7 ++++--- 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")) -- cgit 1.4.1-2-gfad0