[{"id":16869,"web_url":"https://patchwork.libcamera.org/comment/16869/","msgid":"<YJmYJ9UcNK1+Fm/J@oden.dyn.berto.se>","date":"2021-05-10T20:31:35","subject":"Re: [libcamera-devel] [PATCH 7/8] android: Rename\n\tCameraDevice::mutex_","submitter":{"id":5,"url":"https://patchwork.libcamera.org/api/people/5/","name":"Niklas Söderlund","email":"niklas.soderlund@ragnatech.se"},"content":"Hi Jacopo,\n\nThanks for your patch.\n\nOn 2021-05-10 12:52:34 +0200, Jacopo Mondi wrote:\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\nReviewed-by: Niklas Söderlund <niklas.soderlund@ragnatech.se>\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 14a3f79a7402..fa12ce5b0133 100644\n> --- a/src/android/camera_device.cpp\n> +++ b/src/android/camera_device.cpp\n> @@ -2022,7 +2022,7 @@ int CameraDevice::processCaptureRequest(camera3_capture_request_t *camera3Reques\n>  \tworker_.queueRequest(descriptor.request_.get());\n>  \n>  \t{\n> -\t\tMutexLocker lock(mutex_);\n> +\t\tMutexLocker requestsLock(requestsMutex_);\n>  \t\tdescriptors_[descriptor.request_->cookie()] = std::move(descriptor);\n>  \t}\n>  \n> @@ -2033,7 +2033,7 @@ void CameraDevice::requestComplete(Request *request)\n>  {\n>  \tdecltype(descriptors_)::node_type node;\n>  \t{\n> -\t\tMutexLocker lock(mutex_);\n> +\t\tMutexLocker requestsLock(requestsMutex_);\n>  \t\tauto it = descriptors_.find(request->cookie());\n>  \t\tif (it == descriptors_.end()) {\n>  \t\t\t/*\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>  \tstd::map<int, libcamera::PixelFormat> formatsMap_;\n>  \tstd::vector<CameraStream> streams_;\n>  \n> -\tstd::mutex mutex_; /* Protect descriptors_ */\n> +\tlibcamera::Mutex requestsMutex_; /* Protects descriptors_. */\n>  \tstd::map<uint64_t, Camera3RequestDescriptor> descriptors_;\n>  \n>  \tstd::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","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 2E28CBF829\n\tfor <parsemail@patchwork.libcamera.org>;\n\tMon, 10 May 2021 20:31:38 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id E7D1068911;\n\tMon, 10 May 2021 22:31:37 +0200 (CEST)","from mail-lf1-x130.google.com (mail-lf1-x130.google.com\n\t[IPv6:2a00:1450:4864:20::130])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 10901602BE\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tMon, 10 May 2021 22:31:37 +0200 (CEST)","by mail-lf1-x130.google.com with SMTP id c3so25313897lfs.7\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tMon, 10 May 2021 13:31:37 -0700 (PDT)","from localhost (h-209-203.A463.priv.bahnhof.se. [155.4.209.203])\n\tby smtp.gmail.com with ESMTPSA id\n\tx25sm2361898lfe.255.2021.05.10.13.31.35\n\t(version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);\n\tMon, 10 May 2021 13:31:36 -0700 (PDT)"],"Authentication-Results":"lancelot.ideasonboard.com;\n\tdkim=fail reason=\"signature verification failed\" (2048-bit key;\n\tunprotected) header.d=ragnatech-se.20150623.gappssmtp.com\n\theader.i=@ragnatech-se.20150623.gappssmtp.com\n\theader.b=\"Cmgg3E4i\"; dkim-atps=neutral","DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=ragnatech-se.20150623.gappssmtp.com; s=20150623;\n\th=date:from:to:cc:subject:message-id:references:mime-version\n\t:content-disposition:content-transfer-encoding:in-reply-to;\n\tbh=379loQU3JalrPigVlDJOLj0I7yZ2jznDaQWpw1+CiGo=;\n\tb=Cmgg3E4iK13kKYNsNRGro7qNuyZZmsBYWBAAI47XYRC0ql5LDijci5x5DEsdItTZQp\n\tTG6CRiA9gAXNcVBvV8RT1jjPexvpNHKJYpxVIVMvLLId3p6IuKKfUgJXt0D8HFgqdRLL\n\twbn+lQulwUZ5sW7Hf2T2fitNQX4ALxu74zFSjswZn72f9WYMSkjbNkab0FH0YxH++3WE\n\tL70hGXfWF0bJ9vklBc6xcT3NlHfsc2PGf1ZAOSAd/oRw4+R58Z4bWiZwAq9J6ExGe4eI\n\trrvq3nL+GPQenjE2EUdI8uaUSeW8sW6vQIOyYdwFbXxm+phLt2jQFlAO/VU/2MjFOesj\n\t5yww==","X-Google-DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=1e100.net; s=20161025;\n\th=x-gm-message-state:date:from:to:cc:subject:message-id:references\n\t:mime-version:content-disposition:content-transfer-encoding\n\t:in-reply-to;\n\tbh=379loQU3JalrPigVlDJOLj0I7yZ2jznDaQWpw1+CiGo=;\n\tb=B2ADm4aHh/pIRCdB6NIEyfPrQXwqxMKoVJGRTuOLxFiwDiClrtSg7915qOFWRRMJpy\n\tNya6gptkFM2vqP12VcUSdsRTS9OMlvi5W7HkHvqQL71W7rMBKZc6Sswu5xx0zlahIylE\n\tpxDY79a+RPydyMginKqYUGIqWSjR3v5Cw+SNjfJb4GykBtB6JaNswmymAWpM9KEZUKw7\n\tBkSaaXasIVQN9L5nUrV3VKmR8TFeXn3OgpgribOfwMnbLUR7grILuPHYYjDZHg4MSx8z\n\tMF/TugBZ/TkoMYHRx1tFOY7k59kwTJbl82ang9LrE2nWbP30oXDDx2OlQvWRhVa3X9Nl\n\thwTA==","X-Gm-Message-State":"AOAM532Ca5RZ2VDbpY94EZC22Yb97zG17uB4IjPX3d3uowz/rwpyDpLZ\n\t168jaD/uK8qUe0ly/Nh+8eeIZgZZvieTwNfU","X-Google-Smtp-Source":"ABdhPJyFAfNKZg9C5mrDqrsZD8smv0QOyWYd6Tw7N/Gl6lK/oziKGm6OAwl6Qp+FAqDrOyenF2I0DQ==","X-Received":"by 2002:a19:ad41:: with SMTP id\n\ts1mr18244285lfd.306.1620678696559; \n\tMon, 10 May 2021 13:31:36 -0700 (PDT)","Date":"Mon, 10 May 2021 22:31:35 +0200","From":"Niklas =?iso-8859-1?q?S=F6derlund?= <niklas.soderlund@ragnatech.se>","To":"Jacopo Mondi <jacopo@jmondi.org>","Message-ID":"<YJmYJ9UcNK1+Fm/J@oden.dyn.berto.se>","References":"<20210510105235.28319-1-jacopo@jmondi.org>\n\t<20210510105235.28319-8-jacopo@jmondi.org>","MIME-Version":"1.0","Content-Disposition":"inline","In-Reply-To":"<20210510105235.28319-8-jacopo@jmondi.org>","Subject":"Re: [libcamera-devel] [PATCH 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@lists.libcamera.org","Content-Type":"text/plain; charset=\"iso-8859-1\"","Content-Transfer-Encoding":"quoted-printable","Errors-To":"libcamera-devel-bounces@lists.libcamera.org","Sender":"\"libcamera-devel\" <libcamera-devel-bounces@lists.libcamera.org>"}}]