[{"id":21398,"web_url":"https://patchwork.libcamera.org/comment/21398/","msgid":"<YaWmxTyZX/Jw6jDz@pendragon.ideasonboard.com>","date":"2021-11-30T04:21:25","subject":"Re: [libcamera-devel] [PATCH v2 07/11] android: camera_stream:\n\tProtect buffers initialization by mutex_","submitter":{"id":2,"url":"https://patchwork.libcamera.org/api/people/2/","name":"Laurent Pinchart","email":"laurent.pinchart@ideasonboard.com"},"content":"Hi Hiro,\n\nThank you for the patch.\n\nOn Mon, Nov 29, 2021 at 08:44:49PM +0900, 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\nReviewed-by: Laurent Pinchart <laurent.pinchart@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 2AD9BBDB13\n\tfor <parsemail@patchwork.libcamera.org>;\n\tTue, 30 Nov 2021 04:21:52 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id D53E3605B4;\n\tTue, 30 Nov 2021 05:21:51 +0100 (CET)","from perceval.ideasonboard.com (perceval.ideasonboard.com\n\t[213.167.242.64])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 1E66E604FC\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tTue, 30 Nov 2021 05:21:50 +0100 (CET)","from pendragon.ideasonboard.com (62-78-145-57.bb.dnainternet.fi\n\t[62.78.145.57])\n\tby perceval.ideasonboard.com (Postfix) with ESMTPSA id A3ACD8F0;\n\tTue, 30 Nov 2021 05:21:49 +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=\"BFBMQwKp\"; dkim-atps=neutral","DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1638246109;\n\tbh=yDAjHjFEo8Az7I3eLDlBcadeX7lFflJd7Sekrm4kE1A=;\n\th=Date:From:To:Cc:Subject:References:In-Reply-To:From;\n\tb=BFBMQwKpSg4DgLW/VJqm8Sz1XwVIjEcXZ0gzmrdfRTDL0lx/5neMJYMlL3AgBLjUO\n\tE64duQOCupPxiMDSOj+W3lTFPZg9U8nwE6pvdGdpZdaE1YGGq5QwUQTkUpg0+F8T2w\n\t5TNTtsenGOIaIk87i3A4vOdGOJXzsqk+ptngs7z8=","Date":"Tue, 30 Nov 2021 06:21:25 +0200","From":"Laurent Pinchart <laurent.pinchart@ideasonboard.com>","To":"Hirokazu Honda <hiroh@chromium.org>","Message-ID":"<YaWmxTyZX/Jw6jDz@pendragon.ideasonboard.com>","References":"<20211129114453.3186042-1-hiroh@chromium.org>\n\t<20211129114453.3186042-8-hiroh@chromium.org>","MIME-Version":"1.0","Content-Type":"text/plain; charset=utf-8","Content-Disposition":"inline","In-Reply-To":"<20211129114453.3186042-8-hiroh@chromium.org>","Subject":"Re: [libcamera-devel] [PATCH v2 07/11] 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>","Cc":"libcamera-devel@lists.libcamera.org","Errors-To":"libcamera-devel-bounces@lists.libcamera.org","Sender":"\"libcamera-devel\" <libcamera-devel-bounces@lists.libcamera.org>"}}]