From patchwork Thu Nov 3 13:20:36 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Umang Jain X-Patchwork-Id: 17752 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 9EA42BDB16 for ; Thu, 3 Nov 2022 13:20:50 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id F3C8563036; Thu, 3 Nov 2022 14:20:49 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=libcamera.org; s=mail; t=1667481650; bh=8QE3AqEpGJ5ZUaXyG5sF6iZCOZo2K6jCFvTCTV2koHs=; h=To:Date:Subject:List-Id:List-Unsubscribe:List-Archive:List-Post: List-Help:List-Subscribe:From:Reply-To:From; b=YqTj49WAA0kMjZL9/XHvhdQDNM3fzXYBeZ/Mitn45h3egUYSXgCsL5Grbrd5gqqfX DNcECy5NTgBaFfU5pijILMUZI+XHyhmB7YKJypsMYr/ZzSSRywxJXJAnYFUidn24R1 Pkf7WMCFE9G71GPzcIa+ZQeFpMsSBARLe//OrApHjKuz5iAC2bBnhNLwNsNpzmuA8J ivQWotBRc1nOl9yMZJU/zE/e6m8EE1A8A/Yn7olytWmH8JBnHpgEoGkq7GIubOEKDK VXd/Gd7wFdcuF9vAjHjeuG5+yPNmgpsn0E+E8u71cZplXHtFQsHUlkvg9gdGFEztL6 BNrX2ifkSA+bA== Received: from perceval.ideasonboard.com (perceval.ideasonboard.com [IPv6:2001:4b98:dc2:55:216:3eff:fef7:d647]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id D881F61F42 for ; Thu, 3 Nov 2022 14:20:48 +0100 (CET) Authentication-Results: lancelot.ideasonboard.com; dkim=pass (1024-bit key; unprotected) header.d=ideasonboard.com header.i=@ideasonboard.com header.b="fIohdxrW"; dkim-atps=neutral Received: from umang.jainideasonboard.com (unknown [103.251.226.107]) by perceval.ideasonboard.com (Postfix) with ESMTPSA id 379664B2; Thu, 3 Nov 2022 14:20:46 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1667481648; bh=8QE3AqEpGJ5ZUaXyG5sF6iZCOZo2K6jCFvTCTV2koHs=; h=From:To:Cc:Subject:Date:From; b=fIohdxrWXDc3oD1HAU92FNkc1U80m+bbIJ2LUUg3FVu8/9MpuG6rOuiUYeutAMZ1l G4K4uV/wlZqYLF21Un86UR15YSWSlEiL0jlF13GadDwlFcQtVOho1IQQbdd4XdckA+ EyNe+oA9o9gnqih1XbW3IYksr80woKmfdn9UjKEA= To: libcamera-devel@lists.libcamera.org Date: Thu, 3 Nov 2022 18:50:36 +0530 Message-Id: <20221103132041.64644-1-umang.jain@ideasonboard.com> X-Mailer: git-send-email 2.37.3 MIME-Version: 1.0 Subject: [libcamera-devel] [PATCH v3 0/5] Apply clang thread safety annotation libcamera-core and v4l2 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: , X-Patchwork-Original-From: Umang Jain via libcamera-devel From: Umang Jain Reply-To: Umang Jain Errors-To: libcamera-devel-bounces@lists.libcamera.org Sender: "libcamera-devel" (Original cover letter by Hiro) This applies clang thread safety annotations to libcamera/base, and libcamera/camera_manager and v4l2. I cannot annotate Signal and some variables in thread.cpp is because the used Mutexes are invisible from their header files. Changes in v3: - Address Laurent's reviews from v2 - No functional changes, improve readability by reflowing statements - Remove TSA for exitCode_ from 2/5 - Protect cameras_ on cleanup() by taking a lock in 3/5 so that TSA is satisfied Hirokazu Honda (5): libcamera: base: semaphore: Apply clang thread safety annotation libcamera: base: thread: Apply clang thread safety annotation libcamera: camera_manager: Apply clang thread safety annotation v4l2: v4l2_camera_proxy: Apply clang thread safety annotation v4l2: v4l2_camera: Apply clang thread safety annotation include/libcamera/base/semaphore.h | 10 +++++----- src/libcamera/base/semaphore.cpp | 4 +++- src/libcamera/base/thread.cpp | 10 +++++++--- src/libcamera/camera_manager.cpp | 24 +++++++++++++++--------- src/v4l2/v4l2_camera.cpp | 5 ++--- src/v4l2/v4l2_camera.h | 14 ++++++++------ src/v4l2/v4l2_camera_proxy.h | 12 +++++++----- 7 files changed, 47 insertions(+), 32 deletions(-)