Patch Detail
Show a patch.
GET /api/1.1/patches/1847/?format=api
{ "id": 1847, "url": "https://patchwork.libcamera.org/api/1.1/patches/1847/?format=api", "web_url": "https://patchwork.libcamera.org/patch/1847/", "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": "<20190818011329.14499-11-laurent.pinchart@ideasonboard.com>", "date": "2019-08-18T01:13:25", "name": "[libcamera-devel,10/14] android: camera_hal_manager: Stop thread when destroying", "commit_ref": null, "pull_url": null, "state": "accepted", "archived": false, "hash": "feb19142a6a81b24a0aff015bc0a8ded194c9396", "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/1847/mbox/", "series": [ { "id": 464, "url": "https://patchwork.libcamera.org/api/1.1/series/464/?format=api", "web_url": "https://patchwork.libcamera.org/project/libcamera/list/?series=464", "date": "2019-08-18T01:13:15", "name": "Assorted fixes for Android camera HAL", "version": 1, "mbox": "https://patchwork.libcamera.org/series/464/mbox/" } ], "comments": "https://patchwork.libcamera.org/api/patches/1847/comments/", "check": "pending", "checks": "https://patchwork.libcamera.org/api/patches/1847/checks/", "tags": {}, "headers": { "Return-Path": "<laurent.pinchart@ideasonboard.com>", "Received": [ "from perceval.ideasonboard.com (perceval.ideasonboard.com\n\t[IPv6:2001:4b98:dc2:55:216:3eff:fef7:d647])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 5D6E161940\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tSun, 18 Aug 2019 03:13:44 +0200 (CEST)", "from pendragon.bb.dnainternet.fi\n\t(dfj612yhrgyx302h3jwwy-3.rev.dnainternet.fi\n\t[IPv6:2001:14ba:21f5:5b00:ce28:277f:58d7:3ca4])\n\tby perceval.ideasonboard.com (Postfix) with ESMTPSA id E048E11C0\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tSun, 18 Aug 2019 03:13:43 +0200 (CEST)" ], "DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1566090824;\n\tbh=JXS6Uhz0hvmSrZttXF8SpMbmnCyXVT6kiCOJ+T1OmAA=;\n\th=From:To:Subject:Date:In-Reply-To:References:From;\n\tb=aWspm82K2oSRUDpqqHYyTTOKifdcFObMdWUOSwfP84IvWzDaoHU4NkJHNl3ychf3f\n\tlVCj2/WO2rViCdMWqlxRe7VwlpahnfJ4IW1NbQItRjBKss0GMXbPlkua5ErrUFGvQi\n\tMXk9/IuNi3NCxVF/VK5Qv+iHZRM4xYoKj3KcRi4o=", "From": "Laurent Pinchart <laurent.pinchart@ideasonboard.com>", "To": "libcamera-devel@lists.libcamera.org", "Date": "Sun, 18 Aug 2019 04:13:25 +0300", "Message-Id": "<20190818011329.14499-11-laurent.pinchart@ideasonboard.com>", "X-Mailer": "git-send-email 2.21.0", "In-Reply-To": "<20190818011329.14499-1-laurent.pinchart@ideasonboard.com>", "References": "<20190818011329.14499-1-laurent.pinchart@ideasonboard.com>", "MIME-Version": "1.0", "Content-Transfer-Encoding": "8bit", "Subject": "[libcamera-devel] [PATCH 10/14] android: camera_hal_manager: Stop\n\tthread when destroying", "X-BeenThere": "libcamera-devel@lists.libcamera.org", "X-Mailman-Version": "2.1.23", "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>", "X-List-Received-Date": "Sun, 18 Aug 2019 01:13:45 -0000" }, "content": "The CameraHalManager starts a thread that is never stopped. This leads\nto the thread being destroyed while running, which causes a crash. Fix\nthis by stopping the thread and waiting for it to finish in the\ndestructor of the CameraHalManager.\n\nSigned-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>\n---\n src/android/camera_hal_manager.cpp | 9 +++++++++\n src/android/camera_hal_manager.h | 2 ++\n 2 files changed, 11 insertions(+)", "diff": "diff --git a/src/android/camera_hal_manager.cpp b/src/android/camera_hal_manager.cpp\nindex 37ba01355258..063080a0746b 100644\n--- a/src/android/camera_hal_manager.cpp\n+++ b/src/android/camera_hal_manager.cpp\n@@ -28,6 +28,15 @@ LOG_DECLARE_CATEGORY(HAL);\n * their static information and to open and close camera devices.\n */\n \n+CameraHalManager::~CameraHalManager()\n+{\n+\tif (isRunning()) {\n+\t\texit(0);\n+\t\t/* \\todo Wait with a timeout, just in case. */\n+\t\twait();\n+\t}\n+}\n+\n int CameraHalManager::init()\n {\n \t/*\ndiff --git a/src/android/camera_hal_manager.h b/src/android/camera_hal_manager.h\nindex 8228623aba90..502115cf056f 100644\n--- a/src/android/camera_hal_manager.h\n+++ b/src/android/camera_hal_manager.h\n@@ -24,6 +24,8 @@ class CameraProxy;\n class CameraHalManager : public libcamera::Thread\n {\n public:\n+\t~CameraHalManager();\n+\n \tint init();\n \n \tCameraProxy *open(unsigned int id, const hw_module_t *module);\n", "prefixes": [ "libcamera-devel", "10/14" ] }