diff options
author | Kartik K. Agaram <vc@akkartik.com> | 2015-05-07 18:35:33 -0700 |
---|---|---|
committer | Kartik K. Agaram <vc@akkartik.com> | 2015-05-07 19:05:23 -0700 |
commit | 9d670bb58f8841791d7531946601658cedd20229 (patch) | |
tree | 32ca741f5ef6fff0d892be0d0ea51475d41af085 /038scheduler.cc | |
parent | bc4db811c4aef5fce4a0df66bd53fea24c2f70f9 (diff) | |
download | mu-9d670bb58f8841791d7531946601658cedd20229.tar.gz |
1301 - back to the chessboard
Still need a nice syntax for managing the routine under test.
Diffstat (limited to '038scheduler.cc')
-rw-r--r-- | 038scheduler.cc | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/038scheduler.cc b/038scheduler.cc index b8c51e40..012a1761 100644 --- a/038scheduler.cc +++ b/038scheduler.cc @@ -240,3 +240,20 @@ case ROUTINE_STATE: { products.at(0).push_back(result); break; } + +:(before "End Primitive Recipe Declarations") +RESTART, +:(before "End Primitive Recipe Numbers") +Recipe_number["restart"] = RESTART; +:(before "End Primitive Recipe Implementations") +case RESTART: { + assert(ingredients.at(0).size() == 1); // routine id must be scalar + index_t id = ingredients.at(0).at(0); + for (index_t i = 0; i < Routines.size(); ++i) { + if (Routines.at(i)->id == id) { + Routines.at(i)->state = RUNNING; + break; + } + } + break; +} |