diff options
Diffstat (limited to 'utils/ipc/generators/libcamera_templates/proxy_functions.tmpl')
-rw-r--r-- | utils/ipc/generators/libcamera_templates/proxy_functions.tmpl | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/utils/ipc/generators/libcamera_templates/proxy_functions.tmpl b/utils/ipc/generators/libcamera_templates/proxy_functions.tmpl index 8addc2fa..ea9cc86b 100644 --- a/utils/ipc/generators/libcamera_templates/proxy_functions.tmpl +++ b/utils/ipc/generators/libcamera_templates/proxy_functions.tmpl @@ -23,9 +23,12 @@ # \brief Generate function body for IPA stop() function for thread #} {%- macro stop_thread_body() -%} - if (!running_) + ASSERT(state_ != ProxyStopping); + if (state_ != ProxyRunning) return; + state_ = ProxyStopping; + proxy_.invokeMethod(&ThreadProxy::stop, ConnectionTypeBlocking); thread_.exit(); @@ -33,7 +36,7 @@ Thread::current()->dispatchMessages(Message::Type::InvokeMessage); - running_ = false; + state_ = ProxyStopped; {%- endmacro -%} |