[{"id":35380,"web_url":"https://patchwork.libcamera.org/comment/35380/","msgid":"<20250813114645.GB20174@pendragon.ideasonboard.com>","date":"2025-08-13T11:46:45","subject":"Re: [RFC PATCH v2 1/2] libcamera: base: thread: Make\n\t`removeMessages()` public","submitter":{"id":2,"url":"https://patchwork.libcamera.org/api/people/2/","name":"Laurent Pinchart","email":"laurent.pinchart@ideasonboard.com"},"content":"Hi Barnabás,\n\nThank you for the patch.\n\nOn Wed, Aug 13, 2025 at 12:25:00PM +0200, Barnabás Pőcze wrote:\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> ---\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>  \tvoid dispatchMessages(Message::Type type = Message::Type::None,\n>  \t\t\t      Object *receiver = nullptr);\n> +\tvoid removeMessages(Object *receiver);\n\nI wonder if we should extend this with a message type, like in\ndispatchMessages(). I suppose it can be done later.\n\nReviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>\n\n>  \n>  protected:\n>  \tint exec();\n> @@ -64,7 +65,6 @@ private:\n>  \tvoid setThreadAffinityInternal();\n>  \n>  \tvoid postMessage(std::unique_ptr<Message> msg, Object *receiver);\n> -\tvoid removeMessages(Object *receiver);\n>  \n>  \tfriend class Object;\n>  \tfriend class ThreadData;","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 BFFE7BDCC1\n\tfor <parsemail@patchwork.libcamera.org>;\n\tWed, 13 Aug 2025 11:47:07 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 640466922C;\n\tWed, 13 Aug 2025 13:47:07 +0200 (CEST)","from perceval.ideasonboard.com (perceval.ideasonboard.com\n\t[213.167.242.64])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 9C9BB61444\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tWed, 13 Aug 2025 13:47:05 +0200 (CEST)","from pendragon.ideasonboard.com (81-175-209-231.bb.dnainternet.fi\n\t[81.175.209.231])\n\tby perceval.ideasonboard.com (Postfix) with UTF8SMTPSA id 0027C2C5;\n\tWed, 13 Aug 2025 13:46:11 +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=\"oqllXEUx\"; dkim-atps=neutral","DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1755085572;\n\tbh=WeGsQaSGK1FiFsJ0MzU6r1qobb1ylYSM7OngAI8ygkQ=;\n\th=Date:From:To:Cc:Subject:References:In-Reply-To:From;\n\tb=oqllXEUxd18xWFmY+oXusPi9JPkBAKNMtJh45flKcHfvEAKRThS6dBEm3cnsVqZm9\n\tvLHKMsB+B8k5BSNDE9jVzo6K3XdCqY5nnyZf5GEcA6ZNVhAuw/pLBKLmeMKbkykpQP\n\tR0aBVUKRDGmV1J1K5+M9VPpKTthaiuwtX3r45/7s=","Date":"Wed, 13 Aug 2025 14:46:45 +0300","From":"Laurent Pinchart <laurent.pinchart@ideasonboard.com>","To":"=?utf-8?q?Barnab=C3=A1s_P=C5=91cze?= <barnabas.pocze@ideasonboard.com>","Cc":"libcamera-devel@lists.libcamera.org","Subject":"Re: [RFC PATCH v2 1/2] libcamera: base: thread: Make\n\t`removeMessages()` public","Message-ID":"<20250813114645.GB20174@pendragon.ideasonboard.com>","References":"<20250813102501.1645940-1-barnabas.pocze@ideasonboard.com>\n\t<20250813102501.1645940-2-barnabas.pocze@ideasonboard.com>","MIME-Version":"1.0","Content-Type":"text/plain; charset=utf-8","Content-Disposition":"inline","Content-Transfer-Encoding":"8bit","In-Reply-To":"<20250813102501.1645940-2-barnabas.pocze@ideasonboard.com>","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>"}},{"id":35381,"web_url":"https://patchwork.libcamera.org/comment/35381/","msgid":"<0c207a9e-03ef-4789-84a6-30f774b58381@ideasonboard.com>","date":"2025-08-13T11:53:10","subject":"Re: [RFC PATCH v2 1/2] libcamera: base: thread: Make\n\t`removeMessages()` public","submitter":{"id":216,"url":"https://patchwork.libcamera.org/api/people/216/","name":"Barnabás Pőcze","email":"barnabas.pocze@ideasonboard.com"},"content":"2025. 08. 13. 13:46 keltezéssel, Laurent Pinchart írta:\n> Hi Barnabás,\n> \n> Thank you for the patch.\n> \n> On Wed, Aug 13, 2025 at 12:25:00PM +0200, Barnabás Pőcze wrote:\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>> ---\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>>   \tvoid dispatchMessages(Message::Type type = Message::Type::None,\n>>   \t\t\t      Object *receiver = nullptr);\n>> +\tvoid removeMessages(Object *receiver);\n> \n> I wonder if we should extend this with a message type, like in\n> dispatchMessages(). I suppose it can be done later.\n\nI'd started doing that but in the end I decided to take the simplest approach.\n\n\n> \n> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>\n> \n>>   \n>>   protected:\n>>   \tint exec();\n>> @@ -64,7 +65,6 @@ private:\n>>   \tvoid setThreadAffinityInternal();\n>>   \n>>   \tvoid postMessage(std::unique_ptr<Message> msg, Object *receiver);\n>> -\tvoid removeMessages(Object *receiver);\n>>   \n>>   \tfriend class Object;\n>>   \tfriend class ThreadData;\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 56AEABEFBE\n\tfor <parsemail@patchwork.libcamera.org>;\n\tWed, 13 Aug 2025 11:53:16 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 69F5469249;\n\tWed, 13 Aug 2025 13:53:15 +0200 (CEST)","from perceval.ideasonboard.com (perceval.ideasonboard.com\n\t[213.167.242.64])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 6726E61444\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tWed, 13 Aug 2025 13:53:14 +0200 (CEST)","from [192.168.33.21] (185.221.141.188.nat.pool.zt.hu\n\t[185.221.141.188])\n\tby perceval.ideasonboard.com (Postfix) with ESMTPSA id AD6732C5;\n\tWed, 13 Aug 2025 13:52:20 +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=\"F6nt5NWA\"; dkim-atps=neutral","DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1755085940;\n\tbh=RK2uDTdeKJmh9j6cM0yyCHbFsYsLIghHlHleQ64Kj9A=;\n\th=Date:Subject:To:Cc:References:From:In-Reply-To:From;\n\tb=F6nt5NWAvNyyP9biehnr/W4tbU6BGfP1xRERmBIiEINorU1kgXXVSF0UbVmJ65atw\n\tXizn+E36T50qJ9wfQRyIZLxQ/ujm0HUPQrugBc5qi2Om/EEA6hOh5TLtNQeQGHmqRI\n\tS9bT4NrbZTgWq8HRmtnA9W8hFc2+3TnCL3DWy5H8=","Message-ID":"<0c207a9e-03ef-4789-84a6-30f774b58381@ideasonboard.com>","Date":"Wed, 13 Aug 2025 13:53:10 +0200","MIME-Version":"1.0","User-Agent":"Mozilla Thunderbird","Subject":"Re: [RFC PATCH v2 1/2] libcamera: base: thread: Make\n\t`removeMessages()` public","To":"Laurent Pinchart <laurent.pinchart@ideasonboard.com>","Cc":"libcamera-devel@lists.libcamera.org","References":"<20250813102501.1645940-1-barnabas.pocze@ideasonboard.com>\n\t<20250813102501.1645940-2-barnabas.pocze@ideasonboard.com>\n\t<20250813114645.GB20174@pendragon.ideasonboard.com>","From":"=?utf-8?q?Barnab=C3=A1s_P=C5=91cze?= <barnabas.pocze@ideasonboard.com>","Content-Language":"en-US, hu-HU","In-Reply-To":"<20250813114645.GB20174@pendragon.ideasonboard.com>","Content-Type":"text/plain; charset=UTF-8; format=flowed","Content-Transfer-Encoding":"8bit","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>"}},{"id":35382,"web_url":"https://patchwork.libcamera.org/comment/35382/","msgid":"<20250813115928.GD20174@pendragon.ideasonboard.com>","date":"2025-08-13T11:59:28","subject":"Re: [RFC PATCH v2 1/2] libcamera: base: thread: Make\n\t`removeMessages()` public","submitter":{"id":2,"url":"https://patchwork.libcamera.org/api/people/2/","name":"Laurent Pinchart","email":"laurent.pinchart@ideasonboard.com"},"content":"On Wed, Aug 13, 2025 at 01:53:10PM +0200, Barnabás Pőcze wrote:\n> 2025. 08. 13. 13:46 keltezéssel, Laurent Pinchart írta:\n> > On Wed, Aug 13, 2025 at 12:25:00PM +0200, Barnabás Pőcze wrote:\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> >> ---\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> >>   \tvoid dispatchMessages(Message::Type type = Message::Type::None,\n> >>   \t\t\t      Object *receiver = nullptr);\n> >> +\tvoid removeMessages(Object *receiver);\n> > \n> > I wonder if we should extend this with a message type, like in\n> > dispatchMessages(). I suppose it can be done later.\n> \n> I'd started doing that but in the end I decided to take the simplest approach.\n\nIn this particular use case I don't expect other message types to exist\nin the queue, so it should be fine. I'm wondering if we won't regret it\nlater, when we'll post other types of messages and wonder why they don't\nget delivered :-)\n\nBy the way, could you please also post a fix for the software ISP ?\n\n> > Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>\n> > \n> >>   \n> >>   protected:\n> >>   \tint exec();\n> >> @@ -64,7 +65,6 @@ private:\n> >>   \tvoid setThreadAffinityInternal();\n> >>   \n> >>   \tvoid postMessage(std::unique_ptr<Message> msg, Object *receiver);\n> >> -\tvoid removeMessages(Object *receiver);\n> >>   \n> >>   \tfriend class Object;\n> >>   \tfriend class ThreadData;","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 49B82BDCC1\n\tfor <parsemail@patchwork.libcamera.org>;\n\tWed, 13 Aug 2025 11:59:49 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 8BED369249;\n\tWed, 13 Aug 2025 13:59:48 +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 F397161444\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tWed, 13 Aug 2025 13:59:46 +0200 (CEST)","from pendragon.ideasonboard.com (81-175-209-231.bb.dnainternet.fi\n\t[81.175.209.231])\n\tby perceval.ideasonboard.com (Postfix) with UTF8SMTPSA id 5756A2C5;\n\tWed, 13 Aug 2025 13:58:53 +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=\"iO8etBCe\"; dkim-atps=neutral","DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1755086333;\n\tbh=yEKx+uLnjDuttbKkRerdlTRJ0fU+yBtVQZQbl695lsE=;\n\th=Date:From:To:Cc:Subject:References:In-Reply-To:From;\n\tb=iO8etBCeVFaSrzNUJ4+CvG6L/gqu57nk+P02vnqRgpaC9z9Ra5eROjVv5m5Te7B5W\n\tDAXhsK8h2DIYEuvcGhPSSZ9nXNoSCbE46MAuVjSKDMgvVNj6Ay9IRABuaczUibXX0s\n\ta+Y1rann+4FbzjLce2As14HlnM6jiWi0m1V5ZrwM=","Date":"Wed, 13 Aug 2025 14:59:28 +0300","From":"Laurent Pinchart <laurent.pinchart@ideasonboard.com>","To":"=?utf-8?q?Barnab=C3=A1s_P=C5=91cze?= <barnabas.pocze@ideasonboard.com>","Cc":"libcamera-devel@lists.libcamera.org","Subject":"Re: [RFC PATCH v2 1/2] libcamera: base: thread: Make\n\t`removeMessages()` public","Message-ID":"<20250813115928.GD20174@pendragon.ideasonboard.com>","References":"<20250813102501.1645940-1-barnabas.pocze@ideasonboard.com>\n\t<20250813102501.1645940-2-barnabas.pocze@ideasonboard.com>\n\t<20250813114645.GB20174@pendragon.ideasonboard.com>\n\t<0c207a9e-03ef-4789-84a6-30f774b58381@ideasonboard.com>","MIME-Version":"1.0","Content-Type":"text/plain; charset=utf-8","Content-Disposition":"inline","Content-Transfer-Encoding":"8bit","In-Reply-To":"<0c207a9e-03ef-4789-84a6-30f774b58381@ideasonboard.com>","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>"}},{"id":35620,"web_url":"https://patchwork.libcamera.org/comment/35620/","msgid":"<841cff92-f4bd-4ee4-8c49-6a18bc15bb59@ideasonboard.com>","date":"2025-08-29T09:09:48","subject":"Re: [RFC PATCH v2 1/2] libcamera: base: thread: Make\n\t`removeMessages()` public","submitter":{"id":216,"url":"https://patchwork.libcamera.org/api/people/216/","name":"Barnabás Pőcze","email":"barnabas.pocze@ideasonboard.com"},"content":"2025. 08. 13. 13:59 keltezéssel, Laurent Pinchart írta:\n> On Wed, Aug 13, 2025 at 01:53:10PM +0200, Barnabás Pőcze wrote:\n>> 2025. 08. 13. 13:46 keltezéssel, Laurent Pinchart írta:\n>>> On Wed, Aug 13, 2025 at 12:25:00PM +0200, Barnabás Pőcze wrote:\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>>>> ---\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>>>>    \tvoid dispatchMessages(Message::Type type = Message::Type::None,\n>>>>    \t\t\t      Object *receiver = nullptr);\n>>>> +\tvoid removeMessages(Object *receiver);\n>>>\n>>> I wonder if we should extend this with a message type, like in\n>>> dispatchMessages(). I suppose it can be done later.\n>>\n>> I'd started doing that but in the end I decided to take the simplest approach.\n> \n> In this particular use case I don't expect other message types to exist\n> in the queue, so it should be fine. I'm wondering if we won't regret it\n> later, when we'll post other types of messages and wonder why they don't\n> get delivered :-)\n> \n> By the way, could you please also post a fix for the software ISP ?\n\nYes, my plan was to do it after this has been merged. Or I can attach\nit to this change set if that seems preferable?\n\n\n> \n>>> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>\n>>>\n>>>>    \n>>>>    protected:\n>>>>    \tint exec();\n>>>> @@ -64,7 +65,6 @@ private:\n>>>>    \tvoid setThreadAffinityInternal();\n>>>>    \n>>>>    \tvoid postMessage(std::unique_ptr<Message> msg, Object *receiver);\n>>>> -\tvoid removeMessages(Object *receiver);\n>>>>    \n>>>>    \tfriend class Object;\n>>>>    \tfriend class ThreadData;\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 1118EBD87C\n\tfor <parsemail@patchwork.libcamera.org>;\n\tFri, 29 Aug 2025 09:09:54 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id AC2C36931A;\n\tFri, 29 Aug 2025 11:09:52 +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 8040F692DF\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tFri, 29 Aug 2025 11:09:51 +0200 (CEST)","from [192.168.33.19] (185.221.143.232.nat.pool.zt.hu\n\t[185.221.143.232])\n\tby perceval.ideasonboard.com (Postfix) with ESMTPSA id 433309CA;\n\tFri, 29 Aug 2025 11:08:46 +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=\"sEFVGnUZ\"; dkim-atps=neutral","DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1756458526;\n\tbh=RA1gXz6ljKkSylBi7CFOPAofi5zYrjGtdbD104rMPS4=;\n\th=Date:Subject:To:Cc:References:From:In-Reply-To:From;\n\tb=sEFVGnUZ7AHYsCHsXjP4P7A5zMxTee90Vz6hdCPo1r42jPdbDUSQu23+LoBYzceaJ\n\tBC2PKIOLRowFOWb4Peg9KdcaSY5j+n6Id0CFzvLJRnRQuvkffs+o8TtzunQ3Qf+nNg\n\tmDiN218/9tX8ksdhgoBlEeyD66uxA/EIFXbfJmcQ=","Message-ID":"<841cff92-f4bd-4ee4-8c49-6a18bc15bb59@ideasonboard.com>","Date":"Fri, 29 Aug 2025 11:09:48 +0200","MIME-Version":"1.0","User-Agent":"Mozilla Thunderbird","Subject":"Re: [RFC PATCH v2 1/2] libcamera: base: thread: Make\n\t`removeMessages()` public","To":"Laurent Pinchart <laurent.pinchart@ideasonboard.com>","Cc":"libcamera-devel@lists.libcamera.org","References":"<20250813102501.1645940-1-barnabas.pocze@ideasonboard.com>\n\t<20250813102501.1645940-2-barnabas.pocze@ideasonboard.com>\n\t<20250813114645.GB20174@pendragon.ideasonboard.com>\n\t<0c207a9e-03ef-4789-84a6-30f774b58381@ideasonboard.com>\n\t<20250813115928.GD20174@pendragon.ideasonboard.com>","From":"=?utf-8?q?Barnab=C3=A1s_P=C5=91cze?= <barnabas.pocze@ideasonboard.com>","Content-Language":"en-US, hu-HU","In-Reply-To":"<20250813115928.GD20174@pendragon.ideasonboard.com>","Content-Type":"text/plain; charset=UTF-8; format=flowed","Content-Transfer-Encoding":"8bit","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>"}},{"id":35621,"web_url":"https://patchwork.libcamera.org/comment/35621/","msgid":"<20250829092055.GC9916@pendragon.ideasonboard.com>","date":"2025-08-29T09:20:55","subject":"Re: [RFC PATCH v2 1/2] libcamera: base: thread: Make\n\t`removeMessages()` public","submitter":{"id":2,"url":"https://patchwork.libcamera.org/api/people/2/","name":"Laurent Pinchart","email":"laurent.pinchart@ideasonboard.com"},"content":"On Fri, Aug 29, 2025 at 11:09:48AM +0200, Barnabás Pőcze wrote:\n> 2025. 08. 13. 13:59 keltezéssel, Laurent Pinchart írta:\n> > On Wed, Aug 13, 2025 at 01:53:10PM +0200, Barnabás Pőcze wrote:\n> >> 2025. 08. 13. 13:46 keltezéssel, Laurent Pinchart írta:\n> >>> On Wed, Aug 13, 2025 at 12:25:00PM +0200, Barnabás Pőcze wrote:\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> >>>> ---\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> >>>>    \tvoid dispatchMessages(Message::Type type = Message::Type::None,\n> >>>>    \t\t\t      Object *receiver = nullptr);\n> >>>> +\tvoid removeMessages(Object *receiver);\n> >>>\n> >>> I wonder if we should extend this with a message type, like in\n> >>> dispatchMessages(). I suppose it can be done later.\n> >>\n> >> I'd started doing that but in the end I decided to take the simplest approach.\n> > \n> > In this particular use case I don't expect other message types to exist\n> > in the queue, so it should be fine. I'm wondering if we won't regret it\n> > later, when we'll post other types of messages and wonder why they don't\n> > get delivered :-)\n> > \n> > By the way, could you please also post a fix for the software ISP ?\n> \n> Yes, my plan was to do it after this has been merged. Or I can attach\n> it to this change set if that seems preferable?\n\nUp to you.\n\n> >>> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>\n> >>>\n> >>>>    \n> >>>>    protected:\n> >>>>    \tint exec();\n> >>>> @@ -64,7 +65,6 @@ private:\n> >>>>    \tvoid setThreadAffinityInternal();\n> >>>>    \n> >>>>    \tvoid postMessage(std::unique_ptr<Message> msg, Object *receiver);\n> >>>> -\tvoid removeMessages(Object *receiver);\n> >>>>    \n> >>>>    \tfriend class Object;\n> >>>>    \tfriend class ThreadData;","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 DA290BEFBE\n\tfor <parsemail@patchwork.libcamera.org>;\n\tFri, 29 Aug 2025 09:21:20 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 8DDD06931A;\n\tFri, 29 Aug 2025 11:21:19 +0200 (CEST)","from perceval.ideasonboard.com (perceval.ideasonboard.com\n\t[213.167.242.64])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id C4D56692DF\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tFri, 29 Aug 2025 11:21:17 +0200 (CEST)","from pendragon.ideasonboard.com (212-76-243-235.access.telenet.be\n\t[212.76.243.235])\n\tby perceval.ideasonboard.com (Postfix) with UTF8SMTPSA id AEB4F13BE; \n\tFri, 29 Aug 2025 11:20:12 +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=\"m1Yq1/68\"; dkim-atps=neutral","DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1756459212;\n\tbh=aXyAUgN5mH64moqv4V+aefnFuaeGFjvUkM2HuA964HA=;\n\th=Date:From:To:Cc:Subject:References:In-Reply-To:From;\n\tb=m1Yq1/68LKwEEkxHWQ4X8b0can+6t+lcJaSCUmE5dy9egzMuJrPy4s3EOEJhGWs59\n\tZGrisbwX4eQZsXTT2rptxkFjRHNT0fh3AfarP9z1yKRZnbiYx8Ej6dvDbV2gfpDeRF\n\t9D4XCr66in1qZqfaQ2KQ2FstuO9+EU7TtyVZENd8=","Date":"Fri, 29 Aug 2025 11:20:55 +0200","From":"Laurent Pinchart <laurent.pinchart@ideasonboard.com>","To":"=?utf-8?q?Barnab=C3=A1s_P=C5=91cze?= <barnabas.pocze@ideasonboard.com>","Cc":"libcamera-devel@lists.libcamera.org","Subject":"Re: [RFC PATCH v2 1/2] libcamera: base: thread: Make\n\t`removeMessages()` public","Message-ID":"<20250829092055.GC9916@pendragon.ideasonboard.com>","References":"<20250813102501.1645940-1-barnabas.pocze@ideasonboard.com>\n\t<20250813102501.1645940-2-barnabas.pocze@ideasonboard.com>\n\t<20250813114645.GB20174@pendragon.ideasonboard.com>\n\t<0c207a9e-03ef-4789-84a6-30f774b58381@ideasonboard.com>\n\t<20250813115928.GD20174@pendragon.ideasonboard.com>\n\t<841cff92-f4bd-4ee4-8c49-6a18bc15bb59@ideasonboard.com>","MIME-Version":"1.0","Content-Type":"text/plain; charset=utf-8","Content-Disposition":"inline","Content-Transfer-Encoding":"8bit","In-Reply-To":"<841cff92-f4bd-4ee4-8c49-6a18bc15bb59@ideasonboard.com>","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>"}}]