about summary refs log tree commit diff stats
path: root/cpp/038scheduler.cc
diff options
context:
space:
mode:
authorKartik K. Agaram <vc@akkartik.com>2015-04-27 01:42:07 -0700
committerKartik K. Agaram <vc@akkartik.com>2015-04-27 01:42:07 -0700
commitc76b49e74ad8b66ac2c077dc0da62c2846131585 (patch)
tree758505eb3b1200fd07a7228b8f55b36e8e7a18cd /cpp/038scheduler.cc
parent08004ec84b755291e5b177748a659b7200c5b5a6 (diff)
downloadmu-c76b49e74ad8b66ac2c077dc0da62c2846131585.tar.gz
1206 - 'wait' state for synchronizing routines
I think I have enough now to port channels over.
Diffstat (limited to 'cpp/038scheduler.cc')
-rw-r--r--cpp/038scheduler.cc4
1 files changed, 2 insertions, 2 deletions
diff --git a/cpp/038scheduler.cc b/cpp/038scheduler.cc
index f0f970dd..76b90933 100644
--- a/cpp/038scheduler.cc
+++ b/cpp/038scheduler.cc
@@ -18,7 +18,7 @@ recipe f2 [
 void run_current_routine(size_t time_slice)
 :(replace "while (!Current_routine->completed())" following "void run_current_routine(size_t time_slice)")
 size_t ninstrs = 0;
-while (!Current_routine->completed() && ninstrs < time_slice)
+while (Current_routine->state == RUNNING && ninstrs < time_slice)
 :(after "Running One Instruction")
 ninstrs++;
 
@@ -28,7 +28,7 @@ ninstrs++;
 enum routine_state {
   RUNNING,
   COMPLETED,
-  // End Routine States
+  // End routine States
 };
 :(before "End routine Fields")
 enum routine_state state;