diff options
author | Kartik K. Agaram <vc@akkartik.com> | 2015-01-10 13:49:16 -0800 |
---|---|---|
committer | Kartik K. Agaram <vc@akkartik.com> | 2015-01-10 13:49:16 -0800 |
commit | ea0d661bb77ca3a844ff7c7268cd5a9b3266265c (patch) | |
tree | d68c3c67405e3125f5284cc5a4d958ced7a358bd /mu.arc | |
parent | 9c2ed239561c069beba0953616ddab15ac21265b (diff) | |
download | mu-ea0d661bb77ca3a844ff7c7268cd5a9b3266265c.tar.gz |
529 - 'sleep' can now wait for a routine to complete
Diffstat (limited to 'mu.arc')
-rw-r--r-- | mu.arc | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/mu.arc b/mu.arc index dcbf5338..ac998383 100644 --- a/mu.arc +++ b/mu.arc @@ -250,6 +250,9 @@ (> curr-cycle* rep.routine!sleep.1) until-location-changes (~is rep.routine!sleep.2 (memory* rep.routine!sleep.1)) + until-routine-done + (find [and _ (is rep._!id rep.routine!sleep.1)] + completed-routines*) )) (on-init @@ -587,6 +590,8 @@ (= rep.routine*!sleep `(until ,wakeup-time))) until-location-changes (= rep.routine*!sleep `(until-location-changes ,(addr arg.1) ,(m arg.1))) + until-routine-done + (= rep.routine*!sleep `(until-routine-done ,(m arg.1))) ; else (die "badly formed 'sleep' call @(tostring:prn (body.routine* pc.routine*))") ) |