From ebe53fdbe64e5ba3128c9de15a9d51c68e7f2fc2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Barnab=C3=A1s=20P=C5=91cze?= Date: Fri, 26 Sep 2025 13:07:07 +0200 Subject: [PATCH] libcamera: base: thread: Make `removeMessages()` public MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sometimes there is a need to remove pending messages of an object. For example, when the main purpose of a thread is to carry out work asynchronously using invoke messages, then there might be a need to stop processing because some kind of state has changed. This can be done in two main ways: flushing messages or removing them. This changes enables the second option, which is useful if the effects of the pending messages are no longer desired. Signed-off-by: Barnabás Pőcze Reviewed-by: Laurent Pinchart Signed-off-by: Kieran Bingham --- include/libcamera/base/thread.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/libcamera/base/thread.h b/include/libcamera/base/thread.h index b9284c2c..eb1a52ab 100644 --- a/include/libcamera/base/thread.h +++ b/include/libcamera/base/thread.h @@ -50,6 +50,7 @@ public: void dispatchMessages(Message::Type type = Message::Type::None, Object *receiver = nullptr); + void removeMessages(Object *receiver); protected: int exec(); @@ -64,7 +65,6 @@ private: void setThreadAffinityInternal(); void postMessage(std::unique_ptr msg, Object *receiver); - void removeMessages(Object *receiver); friend class Object; friend class ThreadData;