Show a patch.

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

{
    "id": 19425,
    "url": "https://patchwork.libcamera.org/api/1.1/patches/19425/?format=api",
    "web_url": "https://patchwork.libcamera.org/patch/19425/",
    "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": "<20240121035948.4226-5-laurent.pinchart@ideasonboard.com>",
    "date": "2024-01-21T03:59:40",
    "name": "[libcamera-devel,04/12] libcamera: thread: Ensure deferred deletion of all objects before stopping",
    "commit_ref": null,
    "pull_url": null,
    "state": "accepted",
    "archived": false,
    "hash": "290a7b5615077f3bf8443725b642d34be2cc173a",
    "submitter": {
        "id": 2,
        "url": "https://patchwork.libcamera.org/api/1.1/people/2/?format=api",
        "name": "Laurent Pinchart",
        "email": "laurent.pinchart@ideasonboard.com"
    },
    "delegate": null,
    "mbox": "https://patchwork.libcamera.org/patch/19425/mbox/",
    "series": [
        {
            "id": 4149,
            "url": "https://patchwork.libcamera.org/api/1.1/series/4149/?format=api",
            "web_url": "https://patchwork.libcamera.org/project/libcamera/list/?series=4149",
            "date": "2024-01-21T03:59:36",
            "name": "libcamera: Hardening against thread race conditions",
            "version": 1,
            "mbox": "https://patchwork.libcamera.org/series/4149/mbox/"
        }
    ],
    "comments": "https://patchwork.libcamera.org/api/patches/19425/comments/",
    "check": "pending",
    "checks": "https://patchwork.libcamera.org/api/patches/19425/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 C9BC9C3243\n\tfor <parsemail@patchwork.libcamera.org>;\n\tSun, 21 Jan 2024 03:59:56 +0000 (UTC)",
            "from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 6F2D16293E;\n\tSun, 21 Jan 2024 04:59:56 +0100 (CET)",
            "from perceval.ideasonboard.com (perceval.ideasonboard.com\n\t[213.167.242.64])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 52C5D62947\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tSun, 21 Jan 2024 04:59:51 +0100 (CET)",
            "from pendragon.ideasonboard.com (89-27-53-110.bb.dnainternet.fi\n\t[89.27.53.110])\n\tby perceval.ideasonboard.com (Postfix) with ESMTPSA id 4066B138B;\n\tSun, 21 Jan 2024 04:58:39 +0100 (CET)"
        ],
        "DKIM-Signature": [
            "v=1; a=rsa-sha256; c=relaxed/simple; d=libcamera.org;\n\ts=mail; t=1705809596;\n\tbh=gqUGYcK7brqQTRQ3ldW7HRkE0TmtK5kwwdbwRLBWFxc=;\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=NPNjqHYTlcueuaDWYvrgfgo7aotbXTa85qrhV1hTjIrE6/gtT45SSnUQw36jjB4z8\n\t5241tGLfPZHD7Qy9YKPgb03zsblCFnGHt4AnNYse08A0peIaXlAXXTvHQ06cjseCbT\n\t8rJLObPTLzghaDQbVxl7c7ROtZu56YkvoAshpliaV2odMoR03aHD+DkexMMvzMeOwF\n\tN6WeXAR6RmKLJ32wKfs+7cann4ThuAiycPfDeYogaX7OPGZAcyY2CjN0mdNF0WlXvD\n\t5kshya9n3YHl7+hQ9qVBAo4tDF+ECynqoF28In0mTk2v94vC8pNX+GerJB6rHMALvx\n\t8YN4qFAlLcN1Q==",
            "v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1705809519;\n\tbh=gqUGYcK7brqQTRQ3ldW7HRkE0TmtK5kwwdbwRLBWFxc=;\n\th=From:To:Cc:Subject:Date:In-Reply-To:References:From;\n\tb=LDgqOCaaJ0bKmk4XhjWG0/VHdcZm6diG/5v/DNK7GMKBS56aMA1/zc9+jDvZMiwy3\n\tISzcBqMDCgO/T45TGAU8WygrHm393zkMP0KCvRJKcsA1L7A1cdHAu5kDCJxvbYtE9H\n\tIWvD4FyxD73rLWSiKrPePgh5UBlKBKC2vUKdBYaw="
        ],
        "Authentication-Results": "lancelot.ideasonboard.com; dkim=pass (1024-bit key; \n\tunprotected) header.d=ideasonboard.com\n\theader.i=@ideasonboard.com\n\theader.b=\"LDgqOCaa\"; dkim-atps=neutral",
        "To": "libcamera-devel@lists.libcamera.org",
        "Date": "Sun, 21 Jan 2024 05:59:40 +0200",
        "Message-ID": "<20240121035948.4226-5-laurent.pinchart@ideasonboard.com>",
        "X-Mailer": "git-send-email 2.43.0",
        "In-Reply-To": "<20240121035948.4226-1-laurent.pinchart@ideasonboard.com>",
        "References": "<20240121035948.4226-1-laurent.pinchart@ideasonboard.com>",
        "MIME-Version": "1.0",
        "Content-Transfer-Encoding": "8bit",
        "Subject": "[libcamera-devel] [PATCH 04/12] libcamera: thread: Ensure deferred\n\tdeletion of all objects before stopping",
        "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": "Laurent Pinchart via libcamera-devel\n\t<libcamera-devel@lists.libcamera.org>",
        "Reply-To": "Laurent Pinchart <laurent.pinchart@ideasonboard.com>",
        "Errors-To": "libcamera-devel-bounces@lists.libcamera.org",
        "Sender": "\"libcamera-devel\" <libcamera-devel-bounces@lists.libcamera.org>"
    },
    "content": "Objects can be scheduled for deletion with Object::deleteLater(), which\nqueues a deferred deletion to the thread's event loop. As the\ndeleteLater() function is meant to be called from a different thread,\nthis may race with thread termination, and deferred deletions queued\njust before calling Thread::exit() may not be processed by the event\nloop. Make sure they get processed when finishing the thread, before\nstopping.\n\nThis fixes a failure in the object-delete unit test.\n\nSigned-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>\n---\n src/libcamera/base/thread.cpp | 6 ++++++\n 1 file changed, 6 insertions(+)",
    "diff": "diff --git a/src/libcamera/base/thread.cpp b/src/libcamera/base/thread.cpp\nindex 75693c92a0b1..4ac72036aa69 100644\n--- a/src/libcamera/base/thread.cpp\n+++ b/src/libcamera/base/thread.cpp\n@@ -371,6 +371,12 @@ void Thread::run()\n \n void Thread::finishThread()\n {\n+\t/*\n+\t * Objects may have been scheduled for deletion right before the thread\n+\t * exited. Ensure they get deleted now, before the thread stops.\n+\t */\n+\tdispatchMessages(Message::Type::DeferredDelete);\n+\n \tdata_->mutex_.lock();\n \tdata_->running_ = false;\n \tdata_->mutex_.unlock();\n",
    "prefixes": [
        "libcamera-devel",
        "04/12"
    ]
}