diff options
author | Kartik K. Agaram <vc@akkartik.com> | 2015-01-11 18:41:23 -0800 |
---|---|---|
committer | Kartik K. Agaram <vc@akkartik.com> | 2015-01-11 18:41:23 -0800 |
commit | e9a5385bf2620662ed67095084199448011e84ea (patch) | |
tree | 5e4517085454e0fffb2369e44051f9249afc794e | |
parent | 405a99708f838f7c9265581ce3e8400d1c225b2d (diff) | |
download | mu-e9a5385bf2620662ed67095084199448011e84ea.tar.gz |
532
-rw-r--r-- | mu.arc | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/mu.arc b/mu.arc index 78af7e04..3487b10f 100644 --- a/mu.arc +++ b/mu.arc @@ -313,10 +313,13 @@ (do (trace "schedule" "pushing " top.routine*!fn-name " to sleep queue") ; keep the clock ticking at rep.routine*!running-since (set sleeping-routines*.routine*)) - (and (~empty routine*) (no rep.routine*!limit)) + empty.routine* + (do (trace "schedule" "done with routine") + (push routine* completed-routines*)) + (no rep.routine*!limit) (do (trace "schedule" "scheduling " top.routine*!fn-name " for further processing") (enq routine* running-routines*)) - (and (~empty routine*) (> rep.routine*!limit 0)) + (> rep.routine*!limit 0) (do (trace "schedule" "scheduling " top.routine*!fn-name " for further processing (limit)") ; stop the clock and debit the time on it from the routine (-- rep.routine*!limit (- curr-cycle* rep.routine*!running-since)) @@ -326,8 +329,7 @@ (push routine* completed-routines*)) (enq routine* running-routines*))) :else - (do (trace "schedule" "done with routine") - (push routine* completed-routines*))) + (err "illegal scheduler state")) (= routine* nil)) ;? (tr 111) (each (routine _) canon.sleeping-routines* |