utils: ipc: proxy: Track IPA with a state machine

Asynchronous tasks can only be submitted while the IPA is running.

Further more, the shutdown sequence can not be tracked with a simple
running flag. We can also be in the state 'Stopping' where we have not
yet completed all events, but we must not commence anything new.

Refactor the running_ boolean into a stateful enum to track this.

Reviewed-by: Paul Elder <paul.elder@ideasonboard.com>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
This commit is contained in:
Kieran Bingham
2021-03-23 13:55:09 +00:00
parent e7d367bf65
commit 70238ceca5
5 changed files with 17 additions and 9 deletions
+1 -1
View File
@@ -37,7 +37,7 @@ LOG_DEFINE_CATEGORY(IPAProxy)
* \param[in] ipam The IPA module
*/
IPAProxy::IPAProxy(IPAModule *ipam)
: valid_(false), ipam_(ipam)
: valid_(false), state_(ProxyStopped), ipam_(ipam)
{
}