utils: ipc: proxy: Assert asynchronous calls execute in the running state
Signals and calls from the IPA should not occur after the IPA has been put into the stopped state. Add assertions to catch and prevent any messages being processed after this. Reviewed-by: Niklas Söderlund <niklas.soderlund@ragnatech.se> Reviewed-by: Jacopo Mondi <jacopo@jmondi.org> Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Signed-off-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
This commit is contained in:
parent
c7dd9655e5
commit
f041482add
2 changed files with 4 additions and 2 deletions
|
@ -173,6 +173,7 @@ void {{proxy_name}}::recvMessage(const IPCMessage &data)
|
|||
{%- endfor -%}
|
||||
);
|
||||
{% elif method|is_async %}
|
||||
ASSERT(running_);
|
||||
proxy_.invokeMethod(&ThreadProxy::{{method.mojom_name}}, ConnectionTypeQueued,
|
||||
{%- for param in method|method_param_names -%}
|
||||
{{param}}{{- ", " if not loop.last}}
|
||||
|
@ -225,6 +226,7 @@ void {{proxy_name}}::recvMessage(const IPCMessage &data)
|
|||
{% for method in interface_event.methods %}
|
||||
{{proxy_funcs.func_sig(proxy_name, method, "Thread")}}
|
||||
{
|
||||
ASSERT(running_);
|
||||
{{method.mojom_name}}.emit({{method.parameters|params_comma_sep}});
|
||||
}
|
||||
|
||||
|
|
|
@ -26,12 +26,12 @@
|
|||
if (!running_)
|
||||
return;
|
||||
|
||||
running_ = false;
|
||||
|
||||
proxy_.invokeMethod(&ThreadProxy::stop, ConnectionTypeBlocking);
|
||||
|
||||
thread_.exit();
|
||||
thread_.wait();
|
||||
|
||||
running_ = false;
|
||||
{%- endmacro -%}
|
||||
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue