Show a patch.

GET /api/patches/15018/?format=api
HTTP 200 OK
Allow: GET, PUT, PATCH, HEAD, OPTIONS
Content-Type: application/json
Vary: Accept

{
    "id": 15018,
    "url": "https://patchwork.libcamera.org/api/patches/15018/?format=api",
    "web_url": "https://patchwork.libcamera.org/patch/15018/",
    "project": {
        "id": 1,
        "url": "https://patchwork.libcamera.org/api/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": "<20211203164619.1541033-6-hiroh@chromium.org>",
    "date": "2021-12-03T16:46:17",
    "name": "[libcamera-devel,5/7] libcamera: camera_manager: Apply clang thread safety annotation",
    "commit_ref": null,
    "pull_url": null,
    "state": "accepted",
    "archived": false,
    "hash": "6cbf1407eafba2e686fcaae26fe54e1febdf18d4",
    "submitter": {
        "id": 63,
        "url": "https://patchwork.libcamera.org/api/people/63/?format=api",
        "name": "Hirokazu Honda",
        "email": "hiroh@chromium.org"
    },
    "delegate": null,
    "mbox": "https://patchwork.libcamera.org/patch/15018/mbox/",
    "series": [
        {
            "id": 2812,
            "url": "https://patchwork.libcamera.org/api/series/2812/?format=api",
            "web_url": "https://patchwork.libcamera.org/project/libcamera/list/?series=2812",
            "date": "2021-12-03T16:46:12",
            "name": "Apply clang thread safety annotation libcamera-core and v4l2",
            "version": 1,
            "mbox": "https://patchwork.libcamera.org/series/2812/mbox/"
        }
    ],
    "comments": "https://patchwork.libcamera.org/api/patches/15018/comments/",
    "check": "pending",
    "checks": "https://patchwork.libcamera.org/api/patches/15018/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 685A7BF415\n\tfor <parsemail@patchwork.libcamera.org>;\n\tFri,  3 Dec 2021 16:46:38 +0000 (UTC)",
            "from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 15B7760832;\n\tFri,  3 Dec 2021 17:46:38 +0100 (CET)",
            "from mail-pj1-x1034.google.com (mail-pj1-x1034.google.com\n\t[IPv6:2607:f8b0:4864:20::1034])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 2B30060832\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tFri,  3 Dec 2021 17:46:35 +0100 (CET)",
            "by mail-pj1-x1034.google.com with SMTP id\n\tk6-20020a17090a7f0600b001ad9d73b20bso654396pjl.3\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tFri, 03 Dec 2021 08:46:35 -0800 (PST)",
            "from hiroh2.tok.corp.google.com\n\t([2401:fa00:8f:203:cd78:3a5f:d792:6177])\n\tby smtp.gmail.com with ESMTPSA id\n\th18sm4123149pfh.172.2021.12.03.08.46.32\n\t(version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);\n\tFri, 03 Dec 2021 08:46:33 -0800 (PST)"
        ],
        "Authentication-Results": "lancelot.ideasonboard.com;\n\tdkim=fail reason=\"signature verification failed\" (1024-bit key;\n\tunprotected) header.d=chromium.org header.i=@chromium.org\n\theader.b=\"JwDVWpJj\"; dkim-atps=neutral",
        "DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org;\n\ts=google; \n\th=from:to:cc:subject:date:message-id:in-reply-to:references\n\t:mime-version:content-transfer-encoding;\n\tbh=aaXWYeJ3wIyj4arkroVtv0cJnoJqlHwOboUzeCUjESo=;\n\tb=JwDVWpJjpbQNdHR8Z1n6g3bj8Zd/+wdklPbFvdfuYliBLy6Qzvo/Ixb6JgHgOCynAX\n\tHYFVRGo16hCmyNgmpiv4pk4KPCRYx+g6h+soJeQt6VopsMwLgalhDOCsjdvtebOj3kht\n\tdKVuGfIw1GX75qw3ZPUz7r+6hdCfjy9vgD3PU=",
        "X-Google-DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=1e100.net; s=20210112;\n\th=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to\n\t:references:mime-version:content-transfer-encoding;\n\tbh=aaXWYeJ3wIyj4arkroVtv0cJnoJqlHwOboUzeCUjESo=;\n\tb=k1cP0cJ+d5gS5BChGCDLcmEiFJlwAWYOm1BPVahPlc0oQYx/shN7p0eyRaVIbyO9gD\n\tUZU0zyPiZ1aSd3+4xeVECXfaa4RHdt9rTV3PrPbEOC30EVGrht+QT/LyFYzA8z8Xjj9y\n\tSZW4eXQG9n94H/pCARb5nzw6/dt+rbcmgxKDnmR22kWK0AJVSAN6iCjJ1x8qLFHh92K9\n\tTW3OSQc0TzEk1Lmz4OoK501O/Q5fS1A3a8hbY7u9k2eF3YhwiJlPGO6h2YUuaPyIJ/zI\n\tg2PcmWrMwHPviNISFP3nlTvjYaohBi/zZkgSUJch14vj5FmPcOKXy6ztmOUYQVIllQKo\n\t+6cA==",
        "X-Gm-Message-State": "AOAM533MJ8gV+O1cdTbs3AdpFFHIHXN6TjTyd93NkyuRC64stXoJuFuI\n\tr6F3yg4gS8Rhd3iZOdnjd+uQGgi8Gd/FNw==",
        "X-Google-Smtp-Source": "ABdhPJwhYrWB0OnZbPCZQH3TwxJV0arqHtzCyWxG2SgBdlqpIJqjnx8elBD3vYVt9ySWBouNrkN7Hw==",
        "X-Received": "by 2002:a17:90a:1913:: with SMTP id\n\t19mr15350770pjg.174.1638549993474; \n\tFri, 03 Dec 2021 08:46:33 -0800 (PST)",
        "From": "Hirokazu Honda <hiroh@chromium.org>",
        "To": "libcamera-devel@lists.libcamera.org",
        "Date": "Sat,  4 Dec 2021 01:46:17 +0900",
        "Message-Id": "<20211203164619.1541033-6-hiroh@chromium.org>",
        "X-Mailer": "git-send-email 2.34.0.384.gca35af8252-goog",
        "In-Reply-To": "<20211203164619.1541033-1-hiroh@chromium.org>",
        "References": "<20211203164619.1541033-1-hiroh@chromium.org>",
        "MIME-Version": "1.0",
        "Content-Transfer-Encoding": "8bit",
        "Subject": "[libcamera-devel] [PATCH 5/7] libcamera: camera_manager: Apply\n\tclang thread 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>",
        "Errors-To": "libcamera-devel-bounces@lists.libcamera.org",
        "Sender": "\"libcamera-devel\" <libcamera-devel-bounces@lists.libcamera.org>"
    },
    "content": "This annotates member functions and variables of\nCameraManager::Private by clang thread safety annotations.\n\nSigned-off-by: Hirokazu Honda <hiroh@chromium.org>\n---\n src/libcamera/camera_manager.cpp | 17 +++++++++--------\n 1 file changed, 9 insertions(+), 8 deletions(-)",
    "diff": "diff --git a/src/libcamera/camera_manager.cpp b/src/libcamera/camera_manager.cpp\nindex 4492edc3..507f68f5 100644\n--- a/src/libcamera/camera_manager.cpp\n+++ b/src/libcamera/camera_manager.cpp\n@@ -42,8 +42,8 @@ public:\n \n \tint start();\n \tvoid addCamera(std::shared_ptr<Camera> camera,\n-\t\t       const std::vector<dev_t> &devnums);\n-\tvoid removeCamera(Camera *camera);\n+\t\t       const std::vector<dev_t> &devnums) LIBCAMERA_TSA_EXCLUDES(mutex_);\n+\tvoid removeCamera(Camera *camera) LIBCAMERA_TSA_EXCLUDES(mutex_);\n \n \t/*\n \t * This mutex protects\n@@ -52,8 +52,8 @@ public:\n \t * - cameras_ and camerasByDevnum_ after initialization\n \t */\n \tmutable Mutex mutex_;\n-\tstd::vector<std::shared_ptr<Camera>> cameras_;\n-\tstd::map<dev_t, std::weak_ptr<Camera>> camerasByDevnum_;\n+\tstd::vector<std::shared_ptr<Camera>> cameras_ LIBCAMERA_TSA_GUARDED_BY(mutex_);\n+\tstd::map<dev_t, std::weak_ptr<Camera>> camerasByDevnum_ LIBCAMERA_TSA_GUARDED_BY(mutex_);\n \n protected:\n \tvoid run() override;\n@@ -61,11 +61,11 @@ protected:\n private:\n \tint init();\n \tvoid createPipelineHandlers();\n-\tvoid cleanup();\n+\tvoid cleanup() LIBCAMERA_TSA_EXCLUDES(mutex_);\n \n \tConditionVariable cv_;\n-\tbool initialized_;\n-\tint status_;\n+\tbool initialized_ LIBCAMERA_TSA_GUARDED_BY(mutex_);\n+\tint status_ LIBCAMERA_TSA_GUARDED_BY(mutex_);\n \n \tstd::unique_ptr<DeviceEnumerator> enumerator_;\n \n@@ -87,7 +87,8 @@ int CameraManager::Private::start()\n \n \t{\n \t\tMutexLocker locker(mutex_);\n-\t\tcv_.wait(locker, [&] { return initialized_; });\n+\t\tcv_.wait(locker,\n+\t\t\t [&]() LIBCAMERA_TSA_REQUIRES(mutex_) { return initialized_; });\n \t\tstatus = status_;\n \t}\n \n",
    "prefixes": [
        "libcamera-devel",
        "5/7"
    ]
}