From patchwork Fri Aug 15 10:21:39 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Barnab=C3=A1s_P=C5=91cze?= X-Patchwork-Id: 24109 Return-Path: X-Original-To: parsemail@patchwork.libcamera.org Delivered-To: parsemail@patchwork.libcamera.org Received: from lancelot.ideasonboard.com (lancelot.ideasonboard.com [92.243.16.209]) by patchwork.libcamera.org (Postfix) with ESMTPS id E3E9CBEFBE for ; Fri, 15 Aug 2025 10:21:45 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id 1EA516924E; Fri, 15 Aug 2025 12:21:45 +0200 (CEST) Authentication-Results: lancelot.ideasonboard.com; dkim=pass (1024-bit key; unprotected) header.d=ideasonboard.com header.i=@ideasonboard.com header.b="c5ANGxWK"; dkim-atps=neutral Received: from perceval.ideasonboard.com (perceval.ideasonboard.com [213.167.242.64]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id 1CD5261443 for ; Fri, 15 Aug 2025 12:21:43 +0200 (CEST) Received: from pb-laptop.local (185.221.141.188.nat.pool.zt.hu [185.221.141.188]) by perceval.ideasonboard.com (Postfix) with ESMTPSA id 139B756D for ; Fri, 15 Aug 2025 12:20:48 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1755253248; bh=9NTxNEjjyMYS+7EV43jqvwRct3/AY6Ad2O989R7onJk=; h=From:To:Subject:Date:From; b=c5ANGxWKToeys0bvki1s5qB4mPssg3WnL60K5wv8+h++o5//Hv7nhKj05qoKP1W12 cTVZIBs1h9XtXfD3gQyYUd2gNahPbn0GUyxrNXbcMS/YNvCaIE4z2dDxQ4Tc9YX+OM 9WhFcb59hlgYWfeZihG4Lrk9c/VxGbbr2xaTMDlk= From: =?utf-8?q?Barnab=C3=A1s_P=C5=91cze?= To: libcamera-devel@lists.libcamera.org Subject: [PATCH v1] libcamera: base: thread: eventDispatcher(): Not thread safe 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 X-BeenThere: libcamera-devel@lists.libcamera.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: libcamera-devel-bounces@lists.libcamera.org Sender: "libcamera-devel" The function is not actually thread safe contrary to its documentation. Since it is currently not used in an unsafe context, simply remove the mention of thread safety from the documentation. The variable must still remain atomic because it is accessed internally from different threads, e.g. `Thread::postMessage()`. Signed-off-by: Barnabás Pőcze Reviewed-by: Laurent Pinchart Reviewed-by: Kieran Bingham --- src/libcamera/base/thread.cpp | 2 -- 1 file changed, 2 deletions(-) diff --git a/src/libcamera/base/thread.cpp b/src/libcamera/base/thread.cpp index d8fe0d697..d7b9b2e6f 100644 --- a/src/libcamera/base/thread.cpp +++ b/src/libcamera/base/thread.cpp @@ -512,8 +512,6 @@ pid_t Thread::currentId() * This function retrieves the internal event dispatcher for the thread. The * returned event dispatcher is valid until the thread is destroyed. * - * \context This function is \threadsafe. - * * \return Pointer to the event dispatcher */ EventDispatcher *Thread::eventDispatcher()