From patchwork Mon Nov 29 11:44:53 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hirokazu Honda X-Patchwork-Id: 14847 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 B6FF3BF415 for ; Mon, 29 Nov 2021 11:45:24 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id 6E7FF605A5; Mon, 29 Nov 2021 12:45:24 +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="iqw5Ia1h"; dkim-atps=neutral Received: from mail-pg1-x529.google.com (mail-pg1-x529.google.com [IPv6:2607:f8b0:4864:20::529]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id 90402605BC for ; Mon, 29 Nov 2021 12:45:20 +0100 (CET) Received: by mail-pg1-x529.google.com with SMTP id r5so15782268pgi.6 for ; Mon, 29 Nov 2021 03:45:20 -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=JedrOwQA5kD3N95srlI/iWKZv5HXuMwvL92/B73i6ws=; b=iqw5Ia1hIfxXBuAIRIfkIv+szDpJ1CELjvJBSehHFECNUWpKeIPmY8GP406VXqQJA0 W55yMgO4Gj1xEOJUGMyng0IqNxC6fS5DdS8CkyF1nSjaDYYfqWiRfF/ZRtiMBrjtV+to ef+U7AymzWl84Ril3haDf9S/oyHpIiBNUSylg= 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=JedrOwQA5kD3N95srlI/iWKZv5HXuMwvL92/B73i6ws=; b=Q5l5BLI9miqTFZZsO8fEmY10Hv+8y1llF6z5yLsesaA7e6j7ahxGa8++WpDOU64/jP 2gHMq9ixdWEMowSGGsjInUFP/Z9pq6dq26VLciTKMsV0oIQ6TJJ6t1a7FIKz7cIvuKm2 S0X6z0yN7Phq6088hG2gP2nyk1WUYBRk8YODO6ySX6DWtepv+gjBygrXDbetHecVNIjw Vh0Wc7083llYbgBTMLRWge88tCaUHQ49oIWwsf62ymXPBx6nnrX9prNBTKHyIfpwvJHO 0OOLqOD3/8qp7x5ZS2hcQHLs4Uj4JfkteRjZdCPfgJDhHEewUkPE6W18AfYxjMQzyDew HL7w== X-Gm-Message-State: AOAM533XLJ5BfPOXsja7bYGlL3SaiaEM60R0oO1DQbRXPhUyaMXBRnM6 f4gOskZENNHE6GwpKSHMqyxuER5q/bQm4w== X-Google-Smtp-Source: ABdhPJxHLDgAWYV3szmQO+O1XR8VdQ2FTgRu0Fb2OGCFy8XD2Qj5j6gVkgDvK1MTWclqhUAi6UWwoQ== X-Received: by 2002:a05:6a00:17a4:b0:49f:c0c0:3263 with SMTP id s36-20020a056a0017a400b0049fc0c03263mr39278900pfg.81.1638186318944; Mon, 29 Nov 2021 03:45:18 -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.17 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 29 Nov 2021 03:45:18 -0800 (PST) From: Hirokazu Honda To: libcamera-devel@lists.libcamera.org Date: Mon, 29 Nov 2021 20:44:53 +0900 Message-Id: <20211129114453.3186042-12-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 11/11] android: camera_request: 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 Camera3RequestDescriptor. Mutex and MutexLocker there are replaced with Mutex2 and MutexLocer2. Signed-off-by: Hirokazu Honda Reviewed-by: Umang Jain Reviewed-by: Laurent Pinchart --- src/android/camera_request.h | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/android/camera_request.h b/src/android/camera_request.h index 88d501a8..dfdc3324 100644 --- a/src/android/camera_request.h +++ b/src/android/camera_request.h @@ -12,7 +12,8 @@ #include #include -#include +#include +#include #include #include @@ -57,7 +58,8 @@ public: }; /* Keeps track of streams requiring post-processing. */ - std::map pendingStreamsToProcess_; + std::map pendingStreamsToProcess_ + LIBCAMERA_TSA_GUARDED_BY(streamsProcessMutex_); libcamera::Mutex streamsProcessMutex_; Camera3RequestDescriptor(libcamera::Camera *camera,