{"id":24109,"url":"https://patchwork.libcamera.org/api/patches/24109/?format=json","web_url":"https://patchwork.libcamera.org/patch/24109/","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":"<20250815102139.2200196-1-barnabas.pocze@ideasonboard.com>","date":"2025-08-15T10:21:39","name":"[v1] libcamera: base: thread: eventDispatcher(): Not thread safe","commit_ref":null,"pull_url":null,"state":"accepted","archived":false,"hash":"507f0a277a94d6712413ee850a15feb6014c0247","submitter":{"id":216,"url":"https://patchwork.libcamera.org/api/people/216/?format=json","name":"Barnabás Pőcze","email":"barnabas.pocze@ideasonboard.com"},"delegate":null,"mbox":"https://patchwork.libcamera.org/patch/24109/mbox/","series":[{"id":5381,"url":"https://patchwork.libcamera.org/api/series/5381/?format=json","web_url":"https://patchwork.libcamera.org/project/libcamera/list/?series=5381","date":"2025-08-15T10:21:39","name":"[v1] libcamera: base: thread: eventDispatcher(): Not thread safe","version":1,"mbox":"https://patchwork.libcamera.org/series/5381/mbox/"}],"comments":"https://patchwork.libcamera.org/api/patches/24109/comments/","check":"pending","checks":"https://patchwork.libcamera.org/api/patches/24109/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 E3E9CBEFBE\n\tfor <parsemail@patchwork.libcamera.org>;\n\tFri, 15 Aug 2025 10:21:45 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 1EA516924E;\n\tFri, 15 Aug 2025 12:21:45 +0200 (CEST)","from perceval.ideasonboard.com (perceval.ideasonboard.com\n\t[213.167.242.64])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 1CD5261443\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tFri, 15 Aug 2025 12:21:43 +0200 (CEST)","from pb-laptop.local (185.221.141.188.nat.pool.zt.hu\n\t[185.221.141.188])\n\tby perceval.ideasonboard.com (Postfix) with ESMTPSA id 139B756D\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tFri, 15 Aug 2025 12:20:48 +0200 (CEST)"],"Authentication-Results":"lancelot.ideasonboard.com; dkim=pass (1024-bit key;\n\tunprotected) header.d=ideasonboard.com header.i=@ideasonboard.com\n\theader.b=\"c5ANGxWK\"; dkim-atps=neutral","DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1755253248;\n\tbh=9NTxNEjjyMYS+7EV43jqvwRct3/AY6Ad2O989R7onJk=;\n\th=From:To:Subject:Date:From;\n\tb=c5ANGxWKToeys0bvki1s5qB4mPssg3WnL60K5wv8+h++o5//Hv7nhKj05qoKP1W12\n\tcTVZIBs1h9XtXfD3gQyYUd2gNahPbn0GUyxrNXbcMS/YNvCaIE4z2dDxQ4Tc9YX+OM\n\t9WhFcb59hlgYWfeZihG4Lrk9c/VxGbbr2xaTMDlk=","From":"=?utf-8?q?Barnab=C3=A1s_P=C5=91cze?= <barnabas.pocze@ideasonboard.com>","To":"libcamera-devel@lists.libcamera.org","Subject":"[PATCH v1] libcamera: base: thread: eventDispatcher(): Not thread\n\tsafe","Date":"Fri, 15 Aug 2025 12:21:39 +0200","Message-ID":"<20250815102139.2200196-1-barnabas.pocze@ideasonboard.com>","X-Mailer":"git-send-email 2.50.1","MIME-Version":"1.0","Content-Type":"text/plain; charset=UTF-8","Content-Transfer-Encoding":"8bit","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 function is not actually thread safe contrary to its documentation.\nSince it is currently not used in an unsafe context, simply remove the\nmention of thread safety from the documentation.\n\nThe variable must still remain atomic because it is accessed internally\nfrom different threads, e.g. `Thread::postMessage()`.\n\nSigned-off-by: Barnabás Pőcze <barnabas.pocze@ideasonboard.com>\n---\n src/libcamera/base/thread.cpp | 2 --\n 1 file changed, 2 deletions(-)","diff":"diff --git a/src/libcamera/base/thread.cpp b/src/libcamera/base/thread.cpp\nindex d8fe0d697..d7b9b2e6f 100644\n--- a/src/libcamera/base/thread.cpp\n+++ b/src/libcamera/base/thread.cpp\n@@ -512,8 +512,6 @@ pid_t Thread::currentId()\n  * This function retrieves the internal event dispatcher for the thread. The\n  * returned event dispatcher is valid until the thread is destroyed.\n  *\n- * \\context This function is \\threadsafe.\n- *\n  * \\return Pointer to the event dispatcher\n  */\n EventDispatcher *Thread::eventDispatcher()\n","prefixes":["v1"]}