{"id":9087,"url":"https://patchwork.libcamera.org/api/covers/9087/?format=json","web_url":"https://patchwork.libcamera.org/cover/9087/","project":{"id":1,"url":"https://patchwork.libcamera.org/api/projects/1/?format=json","name":"libcamera","link_name":"libcamera","list_id":"libcamera_core","list_email":"libcamera-devel@lists.libcamera.org","web_url":"","scm_url":"","webscm_url":""},"msgid":"<20200731133947.84258-1-email@uajain.com>","date":"2020-07-31T13:39:52","name":"[libcamera-devel,v3,0/3] Add Object::deleteLater() support","submitter":{"id":1,"url":"https://patchwork.libcamera.org/api/people/1/?format=json","name":"Umang Jain","email":"email@uajain.com"},"mbox":"https://patchwork.libcamera.org/cover/9087/mbox/","series":[{"id":1168,"url":"https://patchwork.libcamera.org/api/series/1168/?format=json","web_url":"https://patchwork.libcamera.org/project/libcamera/list/?series=1168","date":"2020-07-31T13:39:52","name":"Add Object::deleteLater() support","version":3,"mbox":"https://patchwork.libcamera.org/series/1168/mbox/"}],"comments":"https://patchwork.libcamera.org/api/covers/9087/comments/","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 E96D0BD878\n\tfor <parsemail@patchwork.libcamera.org>;\n\tFri, 31 Jul 2020 13:39:55 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 411D261DCF;\n\tFri, 31 Jul 2020 15:39:55 +0200 (CEST)","from o1.f.az.sendgrid.net (o1.f.az.sendgrid.net [208.117.55.132])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 3F2F260398\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tFri, 31 Jul 2020 15:39:54 +0200 (CEST)","by filterdrecv-p3mdw1-7ff865655c-g882x with SMTP id\n\tfilterdrecv-p3mdw1-7ff865655c-g882x-20-5F241F28-4F\n\t2020-07-31 13:39:52.777678457 +0000 UTC m=+156222.255847520","from mail.uajain.com (unknown)\n\tby ismtpd0006p1hnd1.sendgrid.net (SG) with ESMTP id\n\tk7-u94p2T0KoV6lnWcaagw for <libcamera-devel@lists.libcamera.org>;\n\tFri, 31 Jul 2020 13:39:52.366 +0000 (UTC)"],"Authentication-Results":"lancelot.ideasonboard.com;\n\tdkim=fail reason=\"signature verification failed\" (1024-bit key;\n\tunprotected) header.d=uajain.com header.i=@uajain.com\n\theader.b=\"e/PRgMsR\"; dkim-atps=neutral","DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed; d=uajain.com;\n\th=from:subject:mime-version:to:cc:content-transfer-encoding:\n\tcontent-type;\n\ts=s1; bh=ZFE6B/f5by20p3Ug15oaegZvlQiuBRRNoM6HSMeK4eY=;\n\tb=e/PRgMsRNk0jtudUNdFm2YkdTB4PYz4IVBUC8r2qHgq5cpE8YHspy/M5VtfTe3TT3w72\n\t73rTKH+/a3t4PWrC9aOsFW/B0CjlMYmhPxlzwadRL+tn+ANFwaEEACDO9FfWvzDM4ARyXh\n\tcX4mh6iElHT/VIAyagSSgBJP1wFbEwvfQ=","From":"Umang Jain <email@uajain.com>","Date":"Fri, 31 Jul 2020 13:39:52 +0000 (UTC)","Message-Id":"<20200731133947.84258-1-email@uajain.com>","Mime-Version":"1.0","X-SG-EID":"1Q40EQ7YGir8a9gjSIAdTjhngY657NMk9ckeo4dbHZDiOpywc/L3L9rFqlwE4KPcp6CL6ozs3IeZvk96OtB41FraVTNUEerr68HEcxQWFp7KCL1EDPr1Toh858nCzu9GGoBcRYn338QJcRejp7o7IJwC5RFp37UsSgcGPjjGQyFWpXXEKh/7dCPZ9hraNKbXbtC8nLI+CdCiA6ErxskT4AAljraR2i13omJ1Px84uLU6k4aXGoVFOM+DSx8/9AAJRYWNfEHG0qnfTkyUL78dfg==","To":"libcamera-devel@lists.libcamera.org","Subject":"[libcamera-devel] [PATCH v3 0/3] Add Object::deleteLater() support","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=\"us-ascii\"","Content-Transfer-Encoding":"7bit","Errors-To":"libcamera-devel-bounces@lists.libcamera.org","Sender":"\"libcamera-devel\" <libcamera-devel-bounces@lists.libcamera.org>"},"content":"Implementation of Object::deleteLater() which ensures shared objects\nare deleted in the thread to which they belong. This fixes the issue\nwhere on hot-unplug, the Camera object is deleted in QCam's application\nthread instead of CameraManager's thread and triggering the ASSERT()\nin processNotifier (since the event notifier got deleted out of \ncontext in a different thread). See [1] for discussion.\n\n[1] https://lists.libcamera.org/pipermail/libcamera-devel/2020-July/010951.html\n\nChanges in v3:\n  - Address review for 1/3. dispatchMessages() message loop changed to support\n    handling dispatching of all or per type messages.\n\nChanges in v2:\n  - Extend Thread::setEventDispatcher to selectively deliver messages\n    - This will help if we want to explicitly deliver some messages if\n      event loop is not running.\n  - Include Object::deleteLater() unit test\n    - One \\todo here as one case pending to cover; multiple\n      deleteLater() should only delete the object once.\n  - Review comments (mostly documentation fixes).\n\nUmang Jain (3):\n  libcamera: thread: Support selective message dispatch to thread\n  libcamera: object: Add deleteLater() support\n  libcamera: camera: Ensure deletion via deleteLater()\n\n include/libcamera/camera.h           |   3 +-\n include/libcamera/internal/message.h |   1 +\n include/libcamera/internal/thread.h  |   3 +-\n include/libcamera/object.h           |   2 +\n src/libcamera/camera.cpp             |   2 +-\n src/libcamera/camera_manager.cpp     |   6 +-\n src/libcamera/message.cpp            |   2 +\n src/libcamera/object.cpp             |  48 ++++++++++\n src/libcamera/thread.cpp             |  30 +++++--\n test/meson.build                     |   1 +\n test/object-delete.cpp               | 125 +++++++++++++++++++++++++++\n 11 files changed, 210 insertions(+), 13 deletions(-)\n create mode 100644 test/object-delete.cpp"}