From patchwork Fri Oct 29 04:14:24 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hirokazu Honda X-Patchwork-Id: 14413 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 A513CC324E for ; Fri, 29 Oct 2021 04:14:45 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id 58152600C3; Fri, 29 Oct 2021 06:14:45 +0200 (CEST) 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="EunkjQ+k"; dkim-atps=neutral Received: from mail-pj1-x102d.google.com (mail-pj1-x102d.google.com [IPv6:2607:f8b0:4864:20::102d]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id A7945600BF for ; Fri, 29 Oct 2021 06:14:42 +0200 (CEST) Received: by mail-pj1-x102d.google.com with SMTP id gn3so6343595pjb.0 for ; Thu, 28 Oct 2021 21:14:42 -0700 (PDT) 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=6v2IZFgdAKxfsaRmSEdNBR037Vi1LIHxKaYs8A+IT00=; b=EunkjQ+kq/NXaAJgTQsw1vvXRUu9MjoZGVQC8hBEai7sUnw22NkWHmbGzWU6lVg+WL 7fSTZmALItosugJ+4bgCVsf+pT7pmy/lmoWQkz995nw3QVKjnulaT0xzwhzBqH9oRCme a6V/ympoTCD30gx9Uaf+6cEXx5YDm6VAhfnUc= 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=6v2IZFgdAKxfsaRmSEdNBR037Vi1LIHxKaYs8A+IT00=; b=wm1HM8DjdFvfl+luKfsBlOLQw4UOcH2O+84cFABSzpL5alXnAEQXrjcbo0F9+Gdxtr 8Of+FISZM6cS65uxN/iIf6HvSLXv6yMM8xpqMbnVDcKsNEs4wOe9DP8IDjJWT0veU68q IHuF1mLRunlAtrSEAte2CFYrvzxxUlym3q7yA8V22kEHXrE0tuncxl91xJwxRBixHhPw z48dY7e0f1dFNk/cAyfwgBFhWjA0pHbO4EszFkGCwqoRlBuEMR6VbYPyx77Zpx7R5fFK jXhrLTiNkJwyDX0T+KH1Lqk6s/pcxVsbnpT6mUvAKrMaYdlTpLAwTVVIKu9w8F5Rj28/ 8kVg== X-Gm-Message-State: AOAM531T3vxQ+BzRsNVANH9rSvWhEJps7tGk15GrCdmU8/pBVCJ6LoQd gC20z16vU0dNP9L64/7e/Bhx9ZhlEhPBgQ== X-Google-Smtp-Source: ABdhPJyli5Ufi3FIsyOfhQGGsFD/2GS+v+ES9ehsaJ+Z54FzqjWRiJvsq4eC92JYXmZOz8PLwfC5xQ== X-Received: by 2002:a17:90a:7384:: with SMTP id j4mr8986444pjg.185.1635480880995; Thu, 28 Oct 2021 21:14:40 -0700 (PDT) Received: from hiroh2.tok.corp.google.com ([2401:fa00:8f:203:fd56:8786:5663:b946]) by smtp.gmail.com with ESMTPSA id 11sm4826714pfl.41.2021.10.28.21.14.39 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 28 Oct 2021 21:14:40 -0700 (PDT) From: Hirokazu Honda To: libcamera-devel@lists.libcamera.org Date: Fri, 29 Oct 2021 13:14:24 +0900 Message-Id: <20211029041424.1430886-7-hiroh@chromium.org> X-Mailer: git-send-email 2.33.1.1089.g2158813163f-goog In-Reply-To: <20211029041424.1430886-1-hiroh@chromium.org> References: <20211029041424.1430886-1-hiroh@chromium.org> MIME-Version: 1.0 Subject: [libcamera-devel] [RFC PATCH 6/6] 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 --- src/android/camera_request.h | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/android/camera_request.h b/src/android/camera_request.h index cfafa445..0c8e7287 100644 --- a/src/android/camera_request.h +++ b/src/android/camera_request.h @@ -9,10 +9,11 @@ #include #include -#include #include #include +#include +#include #include #include @@ -46,8 +47,8 @@ public: }; /* Keeps track of streams requiring post-processing. */ - std::map pendingStreamsToProcess_; - std::mutex streamsProcessMutex_; + std::map pendingStreamsToProcess_ GUARDED_BY(streamsProcessMutex_); + libcamera::Mutex2 streamsProcessMutex_; Camera3RequestDescriptor(libcamera::Camera *camera, const camera3_capture_request_t *camera3Request);