From patchwork Tue Nov 30 15:55:55 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hirokazu Honda X-Patchwork-Id: 14904 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 D463CBF415 for ; Tue, 30 Nov 2021 15:56:25 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id 6979160733; Tue, 30 Nov 2021 16:56:25 +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="KpZMwVfQ"; dkim-atps=neutral Received: from mail-pl1-x62a.google.com (mail-pl1-x62a.google.com [IPv6:2607:f8b0:4864:20::62a]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id 78C7B6071A for ; Tue, 30 Nov 2021 16:56:21 +0100 (CET) Received: by mail-pl1-x62a.google.com with SMTP id o14so15275749plg.5 for ; Tue, 30 Nov 2021 07:56:21 -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=NsLHxMNeXQ7lFsLe7Zk5ZpE411R8RH9qkNzSxw4joS4=; b=KpZMwVfQmOhY4Ia+BnF/ZMCnA1mZJ0c0O9o8444w8Yj5wYSAQBdcJk5dFWUrSLAXin 3CuuD0EBNxfTKL4R/QEb9wscyLSDufti4b0OQ3OetXU1xqH6dQ5Iw2pV9SGEcjU2QVJw RYh5cqUrVkYA0vrwSp5MgHW/s+5VatnGWvNOM= 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=NsLHxMNeXQ7lFsLe7Zk5ZpE411R8RH9qkNzSxw4joS4=; b=nQW04zgzfs6rVpCooPTwVHpPnlL5EL9coIdcZY2pL/k8kYdfDsFoZam45kSTI3J+rL qP0etTs2STGJquQaqq2HIAJeGzwa2KJhzaGr5UPfUDimO4krZebZjIuCY/YK1rNt2VTx J8henygyv5VT/uYSaQQq2cwx79sz5XzvlPac8xbw60KCllBBIy6TKVuwjwA+fu+MMK3m DNxfi3n6c8k4etvQHO2Mvlnge94TBgslUQWD+i7d6Krh+2DVgG6ukCRbsFnbaBgRWct0 jSjO4Jzx3pkg4YLqczhm9WMiqNn+HCE1lW6I0BIZg/dZkb+ISqU0TJ0Zn71FuneaBxvU YElw== X-Gm-Message-State: AOAM530yonSapeun4IDQOVxRmaTZ9a/bHndetmEwb/bpzFEtORHSLQWh gYCzyGcvVwdL8IS96AkrwHD108H5hhnUKA== X-Google-Smtp-Source: ABdhPJzlfLtqaF4Ejtw+UQiYc5uFNo7FHwc7+ZmhCvwy65E7ZmhWfoVQ85n+DX54IvRGZe7NuzSw+A== X-Received: by 2002:a17:902:f209:b0:141:99d1:7cef with SMTP id m9-20020a170902f20900b0014199d17cefmr124394plc.70.1638287779809; Tue, 30 Nov 2021 07:56:19 -0800 (PST) Received: from hiroh2.tok.corp.google.com ([2401:fa00:8f:203:c90a:5a53:b139:1336]) by smtp.gmail.com with ESMTPSA id pc10sm3510283pjb.9.2021.11.30.07.56.18 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 30 Nov 2021 07:56:19 -0800 (PST) From: Hirokazu Honda To: libcamera-devel@lists.libcamera.org Date: Wed, 1 Dec 2021 00:55:55 +0900 Message-Id: <20211130155600.2203123-8-hiroh@chromium.org> X-Mailer: git-send-email 2.34.0.rc2.393.gf8c9666880-goog In-Reply-To: <20211130155600.2203123-1-hiroh@chromium.org> References: <20211130155600.2203123-1-hiroh@chromium.org> MIME-Version: 1.0 Subject: [libcamera-devel] [PATCH v3 07/12] 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 | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/android/camera_hal_manager.h b/src/android/camera_hal_manager.h index 765701b2..5395d419 100644 --- a/src/android/camera_hal_manager.h +++ b/src/android/camera_hal_manager.h @@ -18,6 +18,7 @@ #include #include +#include #include @@ -53,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_;