diff options
author | Kartik K. Agaram <vc@akkartik.com> | 2016-08-16 11:31:05 -0700 |
---|---|---|
committer | Kartik K. Agaram <vc@akkartik.com> | 2016-08-16 11:31:05 -0700 |
commit | 0de5692bb3bf63a961c956a4f10b5db4ce7dbd27 (patch) | |
tree | e74b23b3012a0a348996600e6c6e9434fe416635 | |
parent | 671635c0caecb4b72ba9c2b65f6865eca2d38cd8 (diff) | |
download | mu-0de5692bb3bf63a961c956a4f10b5db4ce7dbd27.tar.gz |
3192
-rw-r--r-- | 072scheduler.cc | 28 | ||||
-rw-r--r-- | 073wait.cc | 28 |
2 files changed, 28 insertions, 28 deletions
diff --git a/072scheduler.cc b/072scheduler.cc index 99d5488b..c6660206 100644 --- a/072scheduler.cc +++ b/072scheduler.cc @@ -369,34 +369,6 @@ case ROUTINE_STATE: { //:: miscellaneous helpers :(before "End Primitive Recipe Declarations") -RESTART, -:(before "End Primitive Recipe Numbers") -put(Recipe_ordinal, "restart", RESTART); -:(before "End Primitive Recipe Checks") -case RESTART: { - if (SIZE(inst.ingredients) != 1) { - raise << maybe(get(Recipe, r).name) << "'restart' requires exactly one ingredient, but got '" << inst.original_string << "'\n" << end(); - break; - } - if (!is_mu_number(inst.ingredients.at(0))) { - raise << maybe(get(Recipe, r).name) << "first ingredient of 'restart' should be a routine id generated by 'start-running', but got '" << inst.ingredients.at(0).original_string << "'\n" << end(); - break; - } - break; -} -:(before "End Primitive Recipe Implementations") -case RESTART: { - int id = ingredients.at(0).at(0); - for (int i = 0; i < SIZE(Routines); ++i) { - if (Routines.at(i)->id == id) { - Routines.at(i)->state = RUNNING; - break; - } - } - break; -} - -:(before "End Primitive Recipe Declarations") STOP, :(before "End Primitive Recipe Numbers") put(Recipe_ordinal, "stop", STOP); diff --git a/073wait.cc b/073wait.cc index 584e88e3..147d442a 100644 --- a/073wait.cc +++ b/073wait.cc @@ -327,3 +327,31 @@ int some_other_running_routine() { } return 0; } + +:(before "End Primitive Recipe Declarations") +RESTART, +:(before "End Primitive Recipe Numbers") +put(Recipe_ordinal, "restart", RESTART); +:(before "End Primitive Recipe Checks") +case RESTART: { + if (SIZE(inst.ingredients) != 1) { + raise << maybe(get(Recipe, r).name) << "'restart' requires exactly one ingredient, but got '" << inst.original_string << "'\n" << end(); + break; + } + if (!is_mu_number(inst.ingredients.at(0))) { + raise << maybe(get(Recipe, r).name) << "first ingredient of 'restart' should be a routine id generated by 'start-running', but got '" << inst.ingredients.at(0).original_string << "'\n" << end(); + break; + } + break; +} +:(before "End Primitive Recipe Implementations") +case RESTART: { + int id = ingredients.at(0).at(0); + for (int i = 0; i < SIZE(Routines); ++i) { + if (Routines.at(i)->id == id) { + Routines.at(i)->state = RUNNING; + break; + } + } + break; +} |