[{"id":21506,"web_url":"https://patchwork.libcamera.org/comment/21506/","msgid":"<4ea4d6eb-d5ef-2496-b1e2-32ba5214a476@ideasonboard.com>","date":"2021-12-01T10:35:14","subject":"Re: [libcamera-devel] [PATCH v5 08/12] android: camera_stream:\n\tProtect buffers initialization by mutex_","submitter":{"id":86,"url":"https://patchwork.libcamera.org/api/people/86/","name":"Umang Jain","email":"umang.jain@ideasonboard.com"},"content":"Hi Hiro,\n\nOn 12/1/21 1:23 PM, Hirokazu Honda wrote:\n> The initialization on buffers_ in CameraStrean::configure() is not\n> protected by mutex_. It is no problem because configure() is not\n> invoked simultaneously while other functions are called. This\n> protects it to keep the thread safety consistency for buffers access.\n>\n> Signed-off-by: Hirokazu Honda <hiroh@chromium.org>\n> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>\n\n\nReviewed-by: Umang Jain <umang.jain@ideasonboard.com>\n\n> ---\n>   src/android/camera_stream.cpp | 1 +\n>   1 file changed, 1 insertion(+)\n>\n> diff --git a/src/android/camera_stream.cpp b/src/android/camera_stream.cpp\n> index 5a62b7cd..2181d094 100644\n> --- a/src/android/camera_stream.cpp\n> +++ b/src/android/camera_stream.cpp\n> @@ -125,6 +125,7 @@ int CameraStream::configure()\n>   \t\tif (ret < 0)\n>   \t\t\treturn ret;\n>   \n> +\t\tMutexLocker lock(*mutex_);\n>   \t\t/* Save a pointer to the reserved frame buffers */\n>   \t\tfor (const auto &frameBuffer : allocator_->buffers(stream()))\n>   \t\t\tbuffers_.push_back(frameBuffer.get());","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 C1A15BDB13\n\tfor <parsemail@patchwork.libcamera.org>;\n\tWed,  1 Dec 2021 10:35:21 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 7F11060720;\n\tWed,  1 Dec 2021 11:35:21 +0100 (CET)","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 8549D6011D\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tWed,  1 Dec 2021 11:35:20 +0100 (CET)","from [192.168.1.106] (unknown [103.251.226.170])\n\tby perceval.ideasonboard.com (Postfix) with ESMTPSA id 8C9BD8AE;\n\tWed,  1 Dec 2021 11:35:19 +0100 (CET)"],"Authentication-Results":"lancelot.ideasonboard.com; dkim=pass (1024-bit key;\n\tunprotected) header.d=ideasonboard.com header.i=@ideasonboard.com\n\theader.b=\"emDoi3GQ\"; dkim-atps=neutral","DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1638354920;\n\tbh=BZ6Q1+YSjHA2Wm4Y+rLIMA9P7QOztd8Db0imXY66IHQ=;\n\th=Subject:To:References:From:Date:In-Reply-To:From;\n\tb=emDoi3GQh3FPzuN42u1QD3H5s8T3z7RUpPBMLA0DGkN/JYGWLQh83C38OvzmRjk7J\n\tx1JDGDGM2Og0oyl9GurbfZC4NjOLgTv4QEb//f8Ed9MNiqer/7k/v8He9sUJaGwjUS\n\tUyXQO87XhgJQzqtZgrKtpviryW9O2+qF+CNtCLiU=","To":"Hirokazu Honda <hiroh@chromium.org>, libcamera-devel@lists.libcamera.org","References":"<20211201075348.3121186-1-hiroh@chromium.org>\n\t<20211201075348.3121186-9-hiroh@chromium.org>","From":"Umang Jain <umang.jain@ideasonboard.com>","Message-ID":"<4ea4d6eb-d5ef-2496-b1e2-32ba5214a476@ideasonboard.com>","Date":"Wed, 1 Dec 2021 16:05:14 +0530","User-Agent":"Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101\n\tThunderbird/78.10.2","MIME-Version":"1.0","In-Reply-To":"<20211201075348.3121186-9-hiroh@chromium.org>","Content-Type":"text/plain; charset=utf-8; format=flowed","Content-Transfer-Encoding":"7bit","Content-Language":"en-US","Subject":"Re: [libcamera-devel] [PATCH v5 08/12] android: camera_stream:\n\tProtect buffers initialization by mutex_","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>"}}]