base: Add argument to Coroutine class to not run on creation

In some cases, the point where you create a Coroutine is not the same as
where you want to start running it (and want it to switch back to). This
leads to the unnecessary overhead of switching in and out of the
Coroutine. This change adds an optional boolean argument to the
constructor for the Coroutine class to allow for overriding the default
behavior of running the Coroutine upon creation, which in specific cases
can be used to avoid the unnecessary overhead and improve simulator

Change-Id: I044698f85e81ee4144208aee30d133bcb462d35d
Reviewed-by: Anthony Gutierrez <>
Maintainer: Anthony Gutierrez <>
Tested-by: kokoro <>
2 files changed