From patchwork Mon Nov 29 11:44:48 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hirokazu Honda X-Patchwork-Id: 14842 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 B2752C324F for ; Mon, 29 Nov 2021 11:45:15 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id 63BD2605A0; Mon, 29 Nov 2021 12:45:15 +0100 (CET) Authentication-Results: lancelot.ideasonboard.com; dkim=fail reason="signature verification failed" (1024-bit key; unprotected) header.d=chromium.org header.i=@chromium.org header.b="oAC0A7mX"; dkim-atps=neutral Received: from mail-pj1-x102c.google.com (mail-pj1-x102c.google.com [IPv6:2607:f8b0:4864:20::102c]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id 01CF2605A4 for ; Mon, 29 Nov 2021 12:45:12 +0100 (CET) Received: by mail-pj1-x102c.google.com with SMTP id gt5so12528501pjb.1 for ; Mon, 29 Nov 2021 03:45:11 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=QyJp1wo8X/LrCsHfnNuW1F6S94xFr9aQXVRNt3MnHYY=; b=oAC0A7mXC9KmkaIKs1jhcacG/G7wD3TOSj3wCZcsoXgkVPcCllNmxOOnHzlLSA3bou wix0PcpRflq/C1gT8Qc2nQ/SwogoB5eQBNHu+a0XP3YE9u0k17C7Gb4yghJvZKvub6Mr aZmbQUSiblHP2laVaoSFIzGyqR9i64jdFR0hM= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=QyJp1wo8X/LrCsHfnNuW1F6S94xFr9aQXVRNt3MnHYY=; b=C+wNjLnwCncw4mM1PGl+Ij/UWB0//Hz3C9Qgx4Lv/wqozMsERgO3cCaYhFWiQXwXAY TM+Ck6wOyz9K8JIMjzYFqbh/TeU6RLcdIYxmRWnzobQdCBJ2dwB/JhiCnNfmB+fChoyV vUqHYMcCHrCqnShfSI4ObWrcDkOafC+SaiXmGawU359Psdany065K404kxvsXBt3IEmy dAEDtK3nzyM9BsusPXL6SSfE9/v97+UWWDayuxCxSa+RRKyjYh9lHzvWa/5yOh0zMVy/ y5sH/1y4vFYqyYhNECNxWh4JIHCJnAg/nF648UaKvLPELx7T5X2tChSUN1ecUeyO9GSd /I+g== X-Gm-Message-State: AOAM532xTlLwWSkEt7ghZIbyfAu0EkctfgRf/1YLq6tgXyLbTgYvijvX Vn/iLHcC1zvFyS2TpyAyj6B9ZtLt4MwTWA== X-Google-Smtp-Source: ABdhPJzsQM1ti9ua2+qlLmRwvZ/pQ3FAYe63dM3/A8w4BVq1msp0aw0XbDGbDTAzpRvhpSEqe7m12Q== X-Received: by 2002:a17:902:db01:b0:141:ea12:2176 with SMTP id m1-20020a170902db0100b00141ea122176mr60157409plx.44.1638186310286; Mon, 29 Nov 2021 03:45:10 -0800 (PST) Received: from hiroh2.tok.corp.google.com ([2401:fa00:8f:203:f254:cda9:46e8:17b7]) by smtp.gmail.com with ESMTPSA id hg4sm17951966pjb.1.2021.11.29.03.45.08 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 29 Nov 2021 03:45:09 -0800 (PST) From: Hirokazu Honda To: libcamera-devel@lists.libcamera.org Date: Mon, 29 Nov 2021 20:44:48 +0900 Message-Id: <20211129114453.3186042-7-hiroh@chromium.org> X-Mailer: git-send-email 2.34.0.rc2.393.gf8c9666880-goog In-Reply-To: <20211129114453.3186042-1-hiroh@chromium.org> References: <20211129114453.3186042-1-hiroh@chromium.org> MIME-Version: 1.0 Subject: [libcamera-devel] [PATCH v2 06/11] android: camera_hal_manager: Add thread safety annotation 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" This applies clang thread safety annotation to CameraHalManager. Signed-off-by: Hirokazu Honda Reviewed-by: Laurent Pinchart Reviewed-by: Umang Jain --- src/android/camera_hal_manager.h | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/android/camera_hal_manager.h b/src/android/camera_hal_manager.h index c07684a1..5395d419 100644 --- a/src/android/camera_hal_manager.h +++ b/src/android/camera_hal_manager.h @@ -8,7 +8,6 @@ #pragma once #include -#include #include #include #include @@ -18,7 +17,8 @@ #include #include -#include +#include +#include #include @@ -54,14 +54,14 @@ private: void cameraAdded(std::shared_ptr cam); void cameraRemoved(std::shared_ptr cam); - CameraDevice *cameraDeviceFromHalId(unsigned int id); + CameraDevice *cameraDeviceFromHalId(unsigned int id) LIBCAMERA_TSA_REQUIRES(mutex_); std::unique_ptr cameraManager_; CameraHalConfig halConfig_; const camera_module_callbacks_t *callbacks_; - std::vector> cameras_; - std::map cameraIdsMap_; + std::vector> cameras_ LIBCAMERA_TSA_GUARDED_BY(mutex_); + std::map cameraIdsMap_ LIBCAMERA_TSA_GUARDED_BY(mutex_); libcamera::Mutex mutex_; unsigned int numInternalCameras_;