{"id":12461,"url":"https://patchwork.libcamera.org/api/1.1/patches/12461/?format=json","web_url":"https://patchwork.libcamera.org/patch/12461/","project":{"id":1,"url":"https://patchwork.libcamera.org/api/1.1/projects/1/?format=json","name":"libcamera","link_name":"libcamera","list_id":"libcamera_core","list_email":"libcamera-devel@lists.libcamera.org","web_url":"","scm_url":"","webscm_url":""},"msgid":"<20210527220359.30127-8-jacopo@jmondi.org>","date":"2021-05-27T22:03:58","name":"[libcamera-devel,v4,7/8] android: Rename CameraDevice::mutex_","commit_ref":null,"pull_url":null,"state":"superseded","archived":false,"hash":"257cbb675433972ab1e29ba2c88ff9fdda0b5e9d","submitter":{"id":3,"url":"https://patchwork.libcamera.org/api/1.1/people/3/?format=json","name":"Jacopo Mondi","email":"jacopo@jmondi.org"},"delegate":{"id":15,"url":"https://patchwork.libcamera.org/api/1.1/users/15/?format=json","username":"jmondi","first_name":"Jacopo","last_name":"Mondi","email":"jacopo@jmondi.org"},"mbox":"https://patchwork.libcamera.org/patch/12461/mbox/","series":[{"id":2088,"url":"https://patchwork.libcamera.org/api/1.1/series/2088/?format=json","web_url":"https://patchwork.libcamera.org/project/libcamera/list/?series=2088","date":"2021-05-27T22:03:51","name":"Implement flush() camera operation","version":4,"mbox":"https://patchwork.libcamera.org/series/2088/mbox/"}],"comments":"https://patchwork.libcamera.org/api/patches/12461/comments/","check":"pending","checks":"https://patchwork.libcamera.org/api/patches/12461/checks/","tags":{},"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 2618EC3206\n\tfor <parsemail@patchwork.libcamera.org>;\n\tThu, 27 May 2021 22:03:35 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 3271C68934;\n\tFri, 28 May 2021 00:03:34 +0200 (CEST)","from relay10.mail.gandi.net (relay10.mail.gandi.net\n\t[217.70.178.230])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 6D69C602B1\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tFri, 28 May 2021 00:03:26 +0200 (CEST)","(Authenticated sender: jacopo@jmondi.org)\n\tby relay10.mail.gandi.net (Postfix) with ESMTPSA id 6AE3E240004;\n\tThu, 27 May 2021 22:03:25 +0000 (UTC)"],"From":"Jacopo Mondi <jacopo@jmondi.org>","To":"libcamera-devel@lists.libcamera.org","Date":"Fri, 28 May 2021 00:03:58 +0200","Message-Id":"<20210527220359.30127-8-jacopo@jmondi.org>","X-Mailer":"git-send-email 2.31.1","In-Reply-To":"<20210527220359.30127-1-jacopo@jmondi.org>","References":"<20210527220359.30127-1-jacopo@jmondi.org>","MIME-Version":"1.0","Content-Type":"text/plain; charset=UTF-8","Content-Transfer-Encoding":"8bit","Subject":"[libcamera-devel] [PATCH v4 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>","Errors-To":"libcamera-devel-bounces@lists.libcamera.org","Sender":"\"libcamera-devel\" <libcamera-devel-bounces@lists.libcamera.org>"},"content":"With the introduction of an additional mutex class member, the name of\nthe existing one is too generic.\n\nRename CameraDevice::mutex_ in CameraDevice::descriptorsMutex_ and use the\nlibcamera provided libcamera::Mutex type to align the style with the\nrest of the code base.\n\nSigned-off-by: Jacopo Mondi <jacopo@jmondi.org>\nReviewed-by: Niklas Söderlund <niklas.soderlund@ragnatech.se>\nReviewed-by: Hirokazu Honda <hiroh@chromium.org>\nReviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>\n---\n src/android/camera_device.cpp | 4 ++--\n src/android/camera_device.h   | 3 ++-\n 2 files changed, 4 insertions(+), 3 deletions(-)","diff":"diff --git a/src/android/camera_device.cpp b/src/android/camera_device.cpp\nindex 63f7f9d26ab6..a20c3eaa0ff6 100644\n--- a/src/android/camera_device.cpp\n+++ b/src/android/camera_device.cpp\n@@ -2007,7 +2007,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 descriptorsLock(descriptorsMutex_);\n \t\tdescriptors_[descriptor.request_->cookie()] = std::move(descriptor);\n \t}\n \n@@ -2018,7 +2018,7 @@ void CameraDevice::requestComplete(Request *request)\n {\n \tdecltype(descriptors_)::node_type node;\n \t{\n-\t\tMutexLocker lock(mutex_);\n+\t\tMutexLocker descriptorsLock(descriptorsMutex_);\n \t\tauto it = descriptors_.find(request->cookie());\n \t\tif (it == descriptors_.end()) {\n \t\t\t/*\ndiff --git a/src/android/camera_device.h b/src/android/camera_device.h\nindex 117d829ec932..c949fa509ca4 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 descriptorsMutex_; /* Protects descriptors_. */\n \tstd::map<uint64_t, Camera3RequestDescriptor> descriptors_;\n \n \tstd::string maker_;\n","prefixes":["libcamera-devel","v4","7/8"]}