Patch Detail
Show a patch.
GET /api/1.1/patches/16292/?format=api
{ "id": 16292, "url": "https://patchwork.libcamera.org/api/1.1/patches/16292/?format=api", "web_url": "https://patchwork.libcamera.org/patch/16292/", "project": { "id": 1, "url": "https://patchwork.libcamera.org/api/1.1/projects/1/?format=api", "name": "libcamera", "link_name": "libcamera", "list_id": "libcamera_core", "list_email": "libcamera-devel@lists.libcamera.org", "web_url": "", "scm_url": "", "webscm_url": "" }, "msgid": "<20220620165027.549085-6-umang.jain@ideasonboard.com>", "date": "2022-06-20T16:50:27", "name": "[libcamera-devel,v2,5/5] v4l2: v4l2_camera: Apply clang thread safety annotation", "commit_ref": null, "pull_url": null, "state": "superseded", "archived": false, "hash": "3f455b58fc8b4a028831996f249850ea009f9491", "submitter": { "id": 86, "url": "https://patchwork.libcamera.org/api/1.1/people/86/?format=api", "name": "Umang Jain", "email": "umang.jain@ideasonboard.com" }, "delegate": { "id": 12, "url": "https://patchwork.libcamera.org/api/1.1/users/12/?format=api", "username": "uajain", "first_name": "Umang", "last_name": "Jain", "email": "umang.jain@ideasonboard.com" }, "mbox": "https://patchwork.libcamera.org/patch/16292/mbox/", "series": [ { "id": 3196, "url": "https://patchwork.libcamera.org/api/1.1/series/3196/?format=api", "web_url": "https://patchwork.libcamera.org/project/libcamera/list/?series=3196", "date": "2022-06-20T16:50:22", "name": "Apply clang thread safety annotation libcamera-core and v4l2", "version": 2, "mbox": "https://patchwork.libcamera.org/series/3196/mbox/" } ], "comments": "https://patchwork.libcamera.org/api/patches/16292/comments/", "check": "pending", "checks": "https://patchwork.libcamera.org/api/patches/16292/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 B06F3BE173\n\tfor <parsemail@patchwork.libcamera.org>;\n\tMon, 20 Jun 2022 16:50:49 +0000 (UTC)", "from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 62E2165639;\n\tMon, 20 Jun 2022 18:50:49 +0200 (CEST)", "from perceval.ideasonboard.com (perceval.ideasonboard.com\n\t[213.167.242.64])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id A9E5565634\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tMon, 20 Jun 2022 18:50:47 +0200 (CEST)", "from perceval.ideasonboard.com (unknown\n\t[IPv6:2401:4900:1f3f:e389:cb58:4104:f66:a571])\n\tby perceval.ideasonboard.com (Postfix) with ESMTPSA id 771A9883;\n\tMon, 20 Jun 2022 18:50:46 +0200 (CEST)" ], "DKIM-Signature": [ "v=1; a=rsa-sha256; c=relaxed/simple; d=libcamera.org;\n\ts=mail; t=1655743849;\n\tbh=TNAo5JOE5ucC6xv4gLIeCiKNL45QTePppXzuWox7h2A=;\n\th=To:Date:In-Reply-To:References:Subject:List-Id:List-Unsubscribe:\n\tList-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To:\n\tFrom;\n\tb=QcpFBvkTg4Ozm9EMA6cwzGwQRfj9h16BlZCooKCSpD5zbyfjKE2N0BVn9t+DX2TCb\n\tHyvfEVi/gBQifaBfZvZwWPegu3vt3gzYbvoaEaHPISo3LH5gRbAIgxylGu1aFo5zaN\n\t96OjnXes0VyauoI0YOh4xlCUSTcMbj9sWUbZp+8xHGrA8ee5IKvInNL16gGeeWr6iq\n\tzb1Dywvpw9n7b6+RKxEUn/jvwYo6KR33LbLwHPGf2XHuvsC1x/sIqK7G7HFRO6jtxp\n\ttIbo4b2wUU4PK3mQXc01XQeLIeZyf1vWqOvpNSZZuNm03ErfdI37sK9P0Ufap+PMzp\n\th/8a4WgDKAQpQ==", "v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1655743847;\n\tbh=TNAo5JOE5ucC6xv4gLIeCiKNL45QTePppXzuWox7h2A=;\n\th=From:To:Cc:Subject:Date:In-Reply-To:References:From;\n\tb=Et/hdK7gMPrVrLV76lRQapRvPitC1nJobOizYsUEG2Iq5chJdWloqwpUNH05bKuj/\n\tWlqYOGvO98EWS9LMoloRwndN67dctDy7WZIkDql+ayllP0eW8WgmylmtOqwwtYpcg1\n\tAOzxG/lVK/FMX4xJY7ejgpcXd1ptqVVvVJPoqrCs=" ], "Authentication-Results": "lancelot.ideasonboard.com; dkim=pass (1024-bit key; \n\tunprotected) header.d=ideasonboard.com\n\theader.i=@ideasonboard.com\n\theader.b=\"Et/hdK7g\"; dkim-atps=neutral", "To": "libcamera-devel@lists.libcamera.org", "Date": "Mon, 20 Jun 2022 22:20:27 +0530", "Message-Id": "<20220620165027.549085-6-umang.jain@ideasonboard.com>", "X-Mailer": "git-send-email 2.31.1", "In-Reply-To": "<20220620165027.549085-1-umang.jain@ideasonboard.com>", "References": "<20220620165027.549085-1-umang.jain@ideasonboard.com>", "MIME-Version": "1.0", "Content-Transfer-Encoding": "8bit", "Subject": "[libcamera-devel] [PATCH v2 5/5] v4l2: v4l2_camera: Apply clang\n\tthread safety annotation", "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>", "From": "Umang Jain via libcamera-devel <libcamera-devel@lists.libcamera.org>", "Reply-To": "Umang Jain <umang.jain@ideasonboard.com>", "Errors-To": "libcamera-devel-bounces@lists.libcamera.org", "Sender": "\"libcamera-devel\" <libcamera-devel-bounces@lists.libcamera.org>" }, "content": "From: Hirokazu Honda <hiroh@chromium.org>\n\nThis annotates member functions and variables of V4L2Camera by\nclang thread safety annotations.\n\nSigned-off-by: Hirokazu Honda <hiroh@chromium.org>\nSigned-off-by: Umang Jain <umang.jain@ideasonboard.com>\n---\n src/v4l2/v4l2_camera.cpp | 5 ++---\n src/v4l2/v4l2_camera.h | 14 ++++++++------\n 2 files changed, 10 insertions(+), 9 deletions(-)", "diff": "diff --git a/src/v4l2/v4l2_camera.cpp b/src/v4l2/v4l2_camera.cpp\nindex e922b9e6..7b97c2d5 100644\n--- a/src/v4l2/v4l2_camera.cpp\n+++ b/src/v4l2/v4l2_camera.cpp\n@@ -71,11 +71,10 @@ std::vector<V4L2Camera::Buffer> V4L2Camera::completedBuffers()\n {\n \tstd::vector<Buffer> v;\n \n-\tbufferLock_.lock();\n+\tMutexLocker lock(bufferLock_);\n \tfor (std::unique_ptr<Buffer> &metadata : completedBuffers_)\n \t\tv.push_back(*metadata.get());\n \tcompletedBuffers_.clear();\n-\tbufferLock_.unlock();\n \n \treturn v;\n }\n@@ -278,7 +277,7 @@ int V4L2Camera::qbuf(unsigned int index)\n void V4L2Camera::waitForBufferAvailable()\n {\n \tMutexLocker locker(bufferMutex_);\n-\tbufferCV_.wait(locker, [&] {\n+\tbufferCV_.wait(locker, [&]() LIBCAMERA_TSA_REQUIRES(bufferMutex_) {\n \t\t\t return bufferAvailableCount_ >= 1 || !isRunning_;\n \t\t });\n \tif (isRunning_)\ndiff --git a/src/v4l2/v4l2_camera.h b/src/v4l2/v4l2_camera.h\nindex 03e74118..d3483444 100644\n--- a/src/v4l2/v4l2_camera.h\n+++ b/src/v4l2/v4l2_camera.h\n@@ -39,7 +39,7 @@ public:\n \tvoid bind(int efd);\n \tvoid unbind();\n \n-\tstd::vector<Buffer> completedBuffers();\n+\tstd::vector<Buffer> completedBuffers() LIBCAMERA_TSA_EXCLUDES(bufferLock_);\n \n \tint configure(libcamera::StreamConfiguration *streamConfigOut,\n \t\t const libcamera::Size &size,\n@@ -58,13 +58,14 @@ public:\n \n \tint qbuf(unsigned int index);\n \n-\tvoid waitForBufferAvailable();\n-\tbool isBufferAvailable();\n+\tvoid waitForBufferAvailable() LIBCAMERA_TSA_EXCLUDES(bufferMutex_);\n+\tbool isBufferAvailable() LIBCAMERA_TSA_EXCLUDES(bufferMutex_);\n \n \tbool isRunning();\n \n private:\n-\tvoid requestComplete(libcamera::Request *request);\n+\tvoid requestComplete(libcamera::Request *request)\n+\t\tLIBCAMERA_TSA_EXCLUDES(bufferLock_);\n \n \tstd::shared_ptr<libcamera::Camera> camera_;\n \tstd::unique_ptr<libcamera::CameraConfiguration> config_;\n@@ -77,11 +78,12 @@ private:\n \tstd::vector<std::unique_ptr<libcamera::Request>> requestPool_;\n \n \tstd::deque<libcamera::Request *> pendingRequests_;\n-\tstd::deque<std::unique_ptr<Buffer>> completedBuffers_;\n+\tstd::deque<std::unique_ptr<Buffer>> completedBuffers_\n+\t\tLIBCAMERA_TSA_GUARDED_BY(bufferLock_);\n \n \tint efd_;\n \n \tlibcamera::Mutex bufferMutex_;\n \tlibcamera::ConditionVariable bufferCV_;\n-\tunsigned int bufferAvailableCount_;\n+\tunsigned int bufferAvailableCount_ LIBCAMERA_TSA_GUARDED_BY(bufferMutex_);\n };\n", "prefixes": [ "libcamera-devel", "v2", "5/5" ] }