Show a patch.

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

{
    "id": 10887,
    "url": "https://patchwork.libcamera.org/api/1.1/patches/10887/?format=api",
    "web_url": "https://patchwork.libcamera.org/patch/10887/",
    "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": "<20210119123110.2976971-3-niklas.soderlund@ragnatech.se>",
    "date": "2021-01-19T12:31:10",
    "name": "[libcamera-devel,2/2] cam: Fix capturing an precis number of requests",
    "commit_ref": null,
    "pull_url": null,
    "state": "superseded",
    "archived": false,
    "hash": "f03a7f05e7b310358c18c4db1448e9fc5c6f47fc",
    "submitter": {
        "id": 5,
        "url": "https://patchwork.libcamera.org/api/1.1/people/5/?format=api",
        "name": "Niklas Söderlund",
        "email": "niklas.soderlund@ragnatech.se"
    },
    "delegate": {
        "id": 16,
        "url": "https://patchwork.libcamera.org/api/1.1/users/16/?format=api",
        "username": "neg",
        "first_name": "Niklas",
        "last_name": "Söderlund",
        "email": "niklas.soderlund@ragnatech.se"
    },
    "mbox": "https://patchwork.libcamera.org/patch/10887/mbox/",
    "series": [
        {
            "id": 1583,
            "url": "https://patchwork.libcamera.org/api/1.1/series/1583/?format=api",
            "web_url": "https://patchwork.libcamera.org/project/libcamera/list/?series=1583",
            "date": "2021-01-19T12:31:08",
            "name": "cam: Fix races in event loop and long request processing times",
            "version": 1,
            "mbox": "https://patchwork.libcamera.org/series/1583/mbox/"
        }
    ],
    "comments": "https://patchwork.libcamera.org/api/patches/10887/comments/",
    "check": "pending",
    "checks": "https://patchwork.libcamera.org/api/patches/10887/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 DE728C0F1C\n\tfor <parsemail@patchwork.libcamera.org>;\n\tTue, 19 Jan 2021 12:31:19 +0000 (UTC)",
            "from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 06B3B6814C;\n\tTue, 19 Jan 2021 13:31:19 +0100 (CET)",
            "from vsp-unauthed02.binero.net (vsp-unauthed02.binero.net\n\t[195.74.38.227])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 7170F60314\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tTue, 19 Jan 2021 13:31:17 +0100 (CET)",
            "from bismarck.berto.se (p4fca2458.dip0.t-ipconnect.de\n\t[79.202.36.88])\n\tby bin-vsp-out-01.atm.binero.net (Halon) with ESMTPA\n\tid 39a097cf-5a52-11eb-a542-005056917a89;\n\tTue, 19 Jan 2021 13:31:16 +0100 (CET)"
        ],
        "X-Halon-ID": "39a097cf-5a52-11eb-a542-005056917a89",
        "Authorized-sender": "niklas.soderlund@fsdn.se",
        "From": "=?utf-8?q?Niklas_S=C3=B6derlund?= <niklas.soderlund@ragnatech.se>",
        "To": "libcamera-devel@lists.libcamera.org",
        "Date": "Tue, 19 Jan 2021 13:31:10 +0100",
        "Message-Id": "<20210119123110.2976971-3-niklas.soderlund@ragnatech.se>",
        "X-Mailer": "git-send-email 2.30.0",
        "In-Reply-To": "<20210119123110.2976971-1-niklas.soderlund@ragnatech.se>",
        "References": "<20210119123110.2976971-1-niklas.soderlund@ragnatech.se>",
        "MIME-Version": "1.0",
        "Subject": "[libcamera-devel] [PATCH 2/2] cam: Fix capturing an precis number\n\tof requests",
        "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>",
        "Content-Type": "text/plain; charset=\"utf-8\"",
        "Content-Transfer-Encoding": "base64",
        "Errors-To": "libcamera-devel-bounces@lists.libcamera.org",
        "Sender": "\"libcamera-devel\" <libcamera-devel-bounces@lists.libcamera.org>"
    },
    "content": "When moving request processing from the camera manager thread to the\nmain thread a subtle race condition where added when running with the\n--capture=N option.\n\nBefore the change the check of how many request had been queued was ran\nin the camera manager thread and thus could not race with the producer\nthread. After the change if requests are completed faster then they are\nconsumed (the consumer writes them to disk for example) the check may be\ndelayed and more then the expected number of request may be asked to\nprocessed.\n\nSebastian Fricke <sebastian.fricke@posteo.net>\nFixes: 02eae70e15bdbb24 (\"cam: Move request processing to main thread\")\nSigned-off-by: Niklas Söderlund <niklas.soderlund@ragnatech.se>\n---\n src/cam/capture.cpp | 12 ++++++------\n 1 file changed, 6 insertions(+), 6 deletions(-)",
    "diff": "diff --git a/src/cam/capture.cpp b/src/cam/capture.cpp\nindex 113ea49d50046e5b..ef1601c716bfa137 100644\n--- a/src/cam/capture.cpp\n+++ b/src/cam/capture.cpp\n@@ -157,6 +157,12 @@ void Capture::requestComplete(Request *request)\n \tif (request->status() == Request::RequestCancelled)\n \t\treturn;\n \n+\tcaptureCount_++;\n+\tif (captureLimit_ && captureCount_ > captureLimit_) {\n+\t\tloop_->exit(0);\n+\t\treturn;\n+\t}\n+\n \t/*\n \t * Defer processing of the completed request to the event loop, to avoid\n \t * blocking the camera manager thread.\n@@ -206,12 +212,6 @@ void Capture::processRequest(Request *request)\n \n \tstd::cout << info.str() << std::endl;\n \n-\tcaptureCount_++;\n-\tif (captureLimit_ && captureCount_ >= captureLimit_) {\n-\t\tloop_->exit(0);\n-\t\treturn;\n-\t}\n-\n \trequest->reuse(Request::ReuseBuffers);\n \tcamera_->queueRequest(request);\n }\n",
    "prefixes": [
        "libcamera-devel",
        "2/2"
    ]
}