[{"id":16977,"web_url":"https://patchwork.libcamera.org/comment/16977/","msgid":"<CAO5uPHMdoNgOr4_HOV20C5J8cdOYZ01Ds6wu8Hm=HLDhThg5mw@mail.gmail.com>","date":"2021-05-17T05:01:16","subject":"Re: [libcamera-devel] [PATCH v2 7/8] android: Rename\n\tCameraDevice::mutex_","submitter":{"id":63,"url":"https://patchwork.libcamera.org/api/people/63/","name":"Hirokazu Honda","email":"hiroh@chromium.org"},"content":"Hi Jacopo, thank you for the patch.\n\nOn Thu, May 13, 2021 at 6:22 PM Jacopo Mondi <jacopo@jmondi.org> wrote:\n\n> With the introduction of an additional mutex class member, the name of\n> the existing one is too generic.\n>\n> Rename CameraDevice::mutex_ in CameraDevice::requestsMutex_ and use the\n> libcamera provided libcamera::Mutex type to align the style with the\n> rest of the code base.\n>\n> Signed-off-by: Jacopo Mondi <jacopo@jmondi.org>\n> Reviewed-by: Niklas Söderlund <niklas.soderlund@ragnatech.se>\n>\n\nReviewed-by: Hirokazu Honda <hiroh@chromium.org>\n\n\n> ---\n>  src/android/camera_device.cpp | 4 ++--\n>  src/android/camera_device.h   | 3 ++-\n>  2 files changed, 4 insertions(+), 3 deletions(-)\n>\n> diff --git a/src/android/camera_device.cpp b/src/android/camera_device.cpp\n> index c6cd0b6e8be7..7f8c9bd7832d 100644\n> --- a/src/android/camera_device.cpp\n> +++ b/src/android/camera_device.cpp\n> @@ -2024,7 +2024,7 @@ int\n> CameraDevice::processCaptureRequest(camera3_capture_request_t *camera3Reques\n>         worker_.queueRequest(descriptor.request_.get());\n>\n>         {\n> -               MutexLocker lock(mutex_);\n> +               MutexLocker requestsLock(requestsMutex_);\n>                 descriptors_[descriptor.request_->cookie()] =\n> std::move(descriptor);\n>         }\n>\n> @@ -2035,7 +2035,7 @@ void CameraDevice::requestComplete(Request *request)\n>  {\n>         decltype(descriptors_)::node_type node;\n>         {\n> -               MutexLocker lock(mutex_);\n> +               MutexLocker requestsLock(requestsMutex_);\n>                 auto it = descriptors_.find(request->cookie());\n>                 if (it == descriptors_.end()) {\n>                         /*\n> diff --git a/src/android/camera_device.h b/src/android/camera_device.h\n> index f263fdae472a..ed992ae56d5d 100644\n> --- a/src/android/camera_device.h\n> +++ b/src/android/camera_device.h\n> @@ -24,6 +24,7 @@\n>  #include \"libcamera/internal/buffer.h\"\n>  #include \"libcamera/internal/log.h\"\n>  #include \"libcamera/internal/message.h\"\n> +#include \"libcamera/internal/thread.h\"\n>\n>  #include \"camera_metadata.h\"\n>  #include \"camera_stream.h\"\n> @@ -134,7 +135,7 @@ private:\n>         std::map<int, libcamera::PixelFormat> formatsMap_;\n>         std::vector<CameraStream> streams_;\n>\n> -       std::mutex mutex_; /* Protect descriptors_ */\n> +       libcamera::Mutex requestsMutex_; /* Protects descriptors_. */\n>         std::map<uint64_t, Camera3RequestDescriptor> descriptors_;\n>\n>         std::string maker_;\n> --\n> 2.31.1\n>\n> _______________________________________________\n> libcamera-devel mailing list\n> libcamera-devel@lists.libcamera.org\n> https://lists.libcamera.org/listinfo/libcamera-devel\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 668E7C31FB\n\tfor <parsemail@patchwork.libcamera.org>;\n\tMon, 17 May 2021 05:01:31 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id B14CE6891E;\n\tMon, 17 May 2021 07:01:30 +0200 (CEST)","from mail-ej1-x636.google.com (mail-ej1-x636.google.com\n\t[IPv6:2a00:1450:4864:20::636])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id B8EB3602B1\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tMon, 17 May 2021 07:01:29 +0200 (CEST)","by mail-ej1-x636.google.com with SMTP id k10so7150208ejj.8\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tSun, 16 May 2021 22:01:29 -0700 (PDT)"],"Authentication-Results":"lancelot.ideasonboard.com; dkim=pass (1024-bit key;\n\tunprotected) header.d=chromium.org header.i=@chromium.org\n\theader.b=\"nyuAVnr2\"; dkim-atps=neutral","DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org;\n\ts=google; \n\th=mime-version:references:in-reply-to:from:date:message-id:subject:to\n\t:cc; bh=no/rnkzBH5vTbc/cgZw6UQWkauMWfktinMQthVrA+Hw=;\n\tb=nyuAVnr2Ece+7+mvaHqyHfnA9fkFCCZ+TXI3spD0hYYVgUa/iASP8i1XQ5ZoFPyzK7\n\tOHK6qJ4Kd4TiE7ndwYfcy1O6WOgwu3SH/dFhtfhQEZsa+7LcaHLIqonGTNbvXZVRzBP+\n\tG+DrufwtL57gdXJjbiHXXG4yoPqHmMffNtn9o=","X-Google-DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=1e100.net; s=20161025;\n\th=x-gm-message-state:mime-version:references:in-reply-to:from:date\n\t:message-id:subject:to:cc;\n\tbh=no/rnkzBH5vTbc/cgZw6UQWkauMWfktinMQthVrA+Hw=;\n\tb=UrLOPSivVzQRBlGZ/8XGtXPbzZ309yphVHa9ASeJGLuHL7plOzkz4os8azGFkMQXrm\n\t5gqNFNtk+naNyz/ZJcs5YbSTGZ01okU64Sl7Y6LjSffhFb883QKqRo847SWYYfQ2VuUf\n\tc2zlGOXrtjvoBcY0u2bIHlMrh/OYIznlnfSvV1SM1qVRjrxg40ynwvd22gGfc1I1CL2+\n\tYOxu/F1rTlWD3fdVvIkqDVZuCBzkQ5h6ZTHbHp2Py7zdO8E80sws//b4J0wegkXHZk60\n\tqrHdAnKc7cvu4iXmIDvUgFqaRHB7D3ypXBlpR0Y/7+s5x5+9alneOUGZ8QBCSYAyG71F\n\tUE5g==","X-Gm-Message-State":"AOAM531nkv5LfwAYLiXYqHwfsfLMEd9yRn4IuUjph0V0s5R0bhR2AKPc\n\t0O+VObbRYpBPSBOwck2c6PzpEyYXI1i7djuJ4VTzYDvoJmg=","X-Google-Smtp-Source":"ABdhPJyYgszFIRAU+hteD0cVNGqX0ov+L5UZ68mOGjpJAJHjufIz3SsxUAqScZYoppl2PMUE1kUmVMIeFHltR/6eQb0=","X-Received":"by 2002:a17:906:ecf9:: with SMTP id\n\tqt25mr6683090ejb.55.1621227689453; \n\tSun, 16 May 2021 22:01:29 -0700 (PDT)","MIME-Version":"1.0","References":"<20210513092246.42847-1-jacopo@jmondi.org>\n\t<20210513092246.42847-8-jacopo@jmondi.org>","In-Reply-To":"<20210513092246.42847-8-jacopo@jmondi.org>","From":"Hirokazu Honda <hiroh@chromium.org>","Date":"Mon, 17 May 2021 14:01:16 +0900","Message-ID":"<CAO5uPHMdoNgOr4_HOV20C5J8cdOYZ01Ds6wu8Hm=HLDhThg5mw@mail.gmail.com>","To":"Jacopo Mondi <jacopo@jmondi.org>","Content-Type":"multipart/alternative; boundary=\"00000000000087b13b05c27f7cfc\"","Subject":"Re: [libcamera-devel] [PATCH v2 7/8] android: Rename\n\tCameraDevice::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 <libcamera-devel@lists.libcamera.org>","Errors-To":"libcamera-devel-bounces@lists.libcamera.org","Sender":"\"libcamera-devel\" <libcamera-devel-bounces@lists.libcamera.org>"}}]