Register Subprocess timer callbacks prior to OnRun()
This prevents dangling pointers in cases where a Subprocess instance is
created/destroyed prior to EventLoop creation.
Change-Id: Id3a6db20353955da59b912ca555ab561ee18b4c1
Signed-off-by: James Kuszmaul <james.kuszmaul@bluerivertech.com>
diff --git a/aos/starter/subprocess.h b/aos/starter/subprocess.h
index 6de5cb8..784c544 100644
--- a/aos/starter/subprocess.h
+++ b/aos/starter/subprocess.h
@@ -102,8 +102,12 @@
void Start() { HandleCommand(aos::starter::Command::START); }
+ // Stops the command by sending a SIGINT first, followed by a SIGKILL if it's
+ // still alive in 1s.
void Stop() { HandleCommand(aos::starter::Command::STOP); }
+ // Stops the command the same way as Stop() does, but updates internal state
+ // to reflect that the application was terminated.
void Terminate();
// Adds a callback which gets notified when the application changes state.