{"id":12365,"url":"https://patchwork.libcamera.org/api/1.1/patches/12365/?format=json","web_url":"https://patchwork.libcamera.org/patch/12365/","project":{"id":1,"url":"https://patchwork.libcamera.org/api/1.1/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":"<20210523023155.20268-3-laurent.pinchart@ideasonboard.com>","date":"2021-05-23T02:31:53","name":"[libcamera-devel,2/4] libcamera: thread: Enforce dispatchMessages() call context with assert","commit_ref":null,"pull_url":null,"state":"accepted","archived":false,"hash":"f6e5ad06390e937e0b83a66f0d78ecb086fa27ac","submitter":{"id":2,"url":"https://patchwork.libcamera.org/api/1.1/people/2/?format=json","name":"Laurent Pinchart","email":"laurent.pinchart@ideasonboard.com"},"delegate":null,"mbox":"https://patchwork.libcamera.org/patch/12365/mbox/","series":[{"id":2049,"url":"https://patchwork.libcamera.org/api/1.1/series/2049/?format=json","web_url":"https://patchwork.libcamera.org/project/libcamera/list/?series=2049","date":"2021-05-23T02:31:51","name":"libcamera: thread: Documentation fixes and enhancements","version":1,"mbox":"https://patchwork.libcamera.org/series/2049/mbox/"}],"comments":"https://patchwork.libcamera.org/api/patches/12365/comments/","check":"pending","checks":"https://patchwork.libcamera.org/api/patches/12365/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 3813DC3200\n\tfor <parsemail@patchwork.libcamera.org>;\n\tSun, 23 May 2021 02:32:06 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 01EA66891F;\n\tSun, 23 May 2021 04:32:05 +0200 (CEST)","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 0D9EA68911\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tSun, 23 May 2021 04:32:02 +0200 (CEST)","from pendragon.lan (62-78-145-57.bb.dnainternet.fi [62.78.145.57])\n\tby perceval.ideasonboard.com (Postfix) with ESMTPSA id 8BC428E6;\n\tSun, 23 May 2021 04:32:01 +0200 (CEST)"],"Authentication-Results":"lancelot.ideasonboard.com;\n\tdkim=fail reason=\"signature verification failed\" (1024-bit key;\n\tunprotected) header.d=ideasonboard.com header.i=@ideasonboard.com\n\theader.b=\"aLudtdmh\"; dkim-atps=neutral","DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1621737121;\n\tbh=sjECzHXvytrVhD5+5f8Jj7s9oMvnRca65S0EFXMcdSM=;\n\th=From:To:Cc:Subject:Date:In-Reply-To:References:From;\n\tb=aLudtdmhTCjdi4BM5H4KJQOtfRn3ojGsV2GxBsoiEgOc6eatIPfpEimthgpf0hDcQ\n\t16fD+zcrXN21tNImU+KiRxSBpz8udjmhVG6aDVURaQkaWZe1FEzW3bL01DLJjxWWn3\n\tU8FYlAkZh/oyq0N3HPw8EWoNKqgVCpUReFfpbYqs=","From":"Laurent Pinchart <laurent.pinchart@ideasonboard.com>","To":"libcamera-devel@lists.libcamera.org","Date":"Sun, 23 May 2021 05:31:53 +0300","Message-Id":"<20210523023155.20268-3-laurent.pinchart@ideasonboard.com>","X-Mailer":"git-send-email 2.28.1","In-Reply-To":"<20210523023155.20268-1-laurent.pinchart@ideasonboard.com>","References":"<20210523023155.20268-1-laurent.pinchart@ideasonboard.com>","MIME-Version":"1.0","Content-Transfer-Encoding":"8bit","Subject":"[libcamera-devel] [PATCH 2/4] libcamera: thread: Enforce\n\tdispatchMessages() call context with assert","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":"The Thread::dispatchMessages() function is meant to be called from\nwithin the thread only. Catch incorrect usage with an ASSERT().\n\nSigned-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>\n---\n src/libcamera/thread.cpp | 2 ++\n 1 file changed, 2 insertions(+)","diff":"diff --git a/src/libcamera/thread.cpp b/src/libcamera/thread.cpp\nindex 285b808332e8..bc1dcedea0d1 100644\n--- a/src/libcamera/thread.cpp\n+++ b/src/libcamera/thread.cpp\n@@ -560,6 +560,8 @@ void Thread::removeMessages(Object *receiver)\n  */\n void Thread::dispatchMessages(Message::Type type)\n {\n+\tASSERT(data_ == ThreadData::current());\n+\n \tMutexLocker locker(data_->messages_.mutex_);\n \n \tstd::list<std::unique_ptr<Message>> &messages = data_->messages_.list_;\n","prefixes":["libcamera-devel","2/4"]}