[{"id":36013,"web_url":"https://patchwork.libcamera.org/comment/36013/","msgid":"<175905724966.1131930.7368750908820153754@ping.linuxembedded.co.uk>","date":"2025-09-28T11:00:49","subject":"Re: [PATCH v3 1/2] libcamera: base: thread: Make `removeMessages()`\n\tpublic","submitter":{"id":4,"url":"https://patchwork.libcamera.org/api/people/4/","name":"Kieran Bingham","email":"kieran.bingham@ideasonboard.com"},"content":"Quoting Barnabás Pőcze (2025-09-26 12:07:07)\n> Sometimes there is a need to remove pending messages of an object. For example,\n> when the main purpose of a thread is to carry out work asynchronously using\n> invoke messages, then there might be a need to stop processing because some\n> kind of state has changed. This can be done in two main ways: flushing messages\n> or removing them. This changes enables the second option, which is useful if\n> the effects of the pending messages are no longer desired.\n> \n> Signed-off-by: Barnabás Pőcze <barnabas.pocze@ideasonboard.com>\n> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>\nReviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>\n> ---\n>  include/libcamera/base/thread.h | 2 +-\n>  1 file changed, 1 insertion(+), 1 deletion(-)\n> \n> diff --git a/include/libcamera/base/thread.h b/include/libcamera/base/thread.h\n> index b9284c2c0..eb1a52ab1 100644\n> --- a/include/libcamera/base/thread.h\n> +++ b/include/libcamera/base/thread.h\n> @@ -50,6 +50,7 @@ public:\n>  \n>         void dispatchMessages(Message::Type type = Message::Type::None,\n>                               Object *receiver = nullptr);\n> +       void removeMessages(Object *receiver);\n>  \n>  protected:\n>         int exec();\n> @@ -64,7 +65,6 @@ private:\n>         void setThreadAffinityInternal();\n>  \n>         void postMessage(std::unique_ptr<Message> msg, Object *receiver);\n> -       void removeMessages(Object *receiver);\n>  \n>         friend class Object;\n>         friend class ThreadData;\n> -- \n> 2.51.0\n>","headers":{"Return-Path":"<libcamera-devel-bounces@lists.libcamera.org>","X-Original-To":"parsemail@patchwork.libcamera.org","Delivered-To":"parsemail@patchwork.libcamera.org","Received":["from lancelot.ideasonboard.com (lancelot.ideasonboard.com\n\t[92.243.16.209])\n\tby patchwork.libcamera.org (Postfix) with ESMTPS id 1014EC328C\n\tfor <parsemail@patchwork.libcamera.org>;\n\tSun, 28 Sep 2025 11:00:57 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id C8A3D6B5F3;\n\tSun, 28 Sep 2025 13:00:55 +0200 (CEST)","from perceval.ideasonboard.com (perceval.ideasonboard.com\n\t[IPv6:2001:4b98:dc2:55:216:3eff:fef7:d647])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 5FE536936E\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tSun, 28 Sep 2025 13:00:53 +0200 (CEST)","from pendragon.ideasonboard.com\n\t(cpc89244-aztw30-2-0-cust6594.18-1.cable.virginm.net [86.31.185.195])\n\tby perceval.ideasonboard.com (Postfix) with ESMTPSA id 74C1F725;\n\tSun, 28 Sep 2025 12:59:26 +0200 (CEST)"],"Authentication-Results":"lancelot.ideasonboard.com; dkim=pass (1024-bit key;\n\tunprotected) header.d=ideasonboard.com header.i=@ideasonboard.com\n\theader.b=\"ENlGkP/m\"; dkim-atps=neutral","DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1759057166;\n\tbh=w6gICeG4IyxYbhh2OnMC290fwHz5utA7ZzRu5YWRRbg=;\n\th=In-Reply-To:References:Subject:From:Cc:To:Date:From;\n\tb=ENlGkP/mMTLTS0DkWC7bSEcYbXqL0Ps2PJN2m3eTWZJV793GcvZNpnkU4iDar8Yao\n\tkryd6C0zKDR0VqM2SdSYpbegPHj2zgt1zvBSqBsV62T+0Jmz5h6/KEoLqfgCdh4rNI\n\t9ZlzpPdkSz7M45LYvJheGG3JEmUMSsT1gn/qL9VY=","Content-Type":"text/plain; charset=\"utf-8\"","MIME-Version":"1.0","Content-Transfer-Encoding":"quoted-printable","In-Reply-To":"<20250926110708.94112-2-barnabas.pocze@ideasonboard.com>","References":"<20250926110708.94112-1-barnabas.pocze@ideasonboard.com>\n\t<20250926110708.94112-2-barnabas.pocze@ideasonboard.com>","Subject":"Re: [PATCH v3 1/2] libcamera: base: thread: Make `removeMessages()`\n\tpublic","From":"Kieran Bingham <kieran.bingham@ideasonboard.com>","Cc":"Laurent Pinchart <laurent.pinchart@ideasonboard.com>","To":"=?utf-8?q?Barnab=C3=A1s_P=C5=91cze?= <barnabas.pocze@ideasonboard.com>,\n\tlibcamera-devel@lists.libcamera.org","Date":"Sun, 28 Sep 2025 12:00:49 +0100","Message-ID":"<175905724966.1131930.7368750908820153754@ping.linuxembedded.co.uk>","User-Agent":"alot/0.9.1","X-BeenThere":"libcamera-devel@lists.libcamera.org","X-Mailman-Version":"2.1.29","Precedence":"list","List-Id":"<libcamera-devel.lists.libcamera.org>","List-Unsubscribe":"<https://lists.libcamera.org/options/libcamera-devel>,\n\t<mailto:libcamera-devel-request@lists.libcamera.org?subject=unsubscribe>","List-Archive":"<https://lists.libcamera.org/pipermail/libcamera-devel/>","List-Post":"<mailto:libcamera-devel@lists.libcamera.org>","List-Help":"<mailto:libcamera-devel-request@lists.libcamera.org?subject=help>","List-Subscribe":"<https://lists.libcamera.org/listinfo/libcamera-devel>,\n\t<mailto:libcamera-devel-request@lists.libcamera.org?subject=subscribe>","Errors-To":"libcamera-devel-bounces@lists.libcamera.org","Sender":"\"libcamera-devel\" <libcamera-devel-bounces@lists.libcamera.org>"}}]