From patchwork Fri Dec 3 19:55:35 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hirokazu Honda X-Patchwork-Id: 15025 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 096AAC3250 for ; Fri, 3 Dec 2021 19:55:54 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id A768760822; Fri, 3 Dec 2021 20:55:53 +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="KKVmjxnK"; dkim-atps=neutral Received: from mail-pg1-x52b.google.com (mail-pg1-x52b.google.com [IPv6:2607:f8b0:4864:20::52b]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id 1F1FB6084A for ; Fri, 3 Dec 2021 20:55:52 +0100 (CET) Received: by mail-pg1-x52b.google.com with SMTP id f125so4176229pgc.0 for ; Fri, 03 Dec 2021 11:55:52 -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=whlrVtDSaOPOhU9NB9oN0LR43VRxqEnviBCM+Ekagoo=; b=KKVmjxnKvMb71EWA9M+P+TjtX5nDqB2ttT+DTMV7sXwiDHTa/0huKz4daRbJfgwTE3 Io6vzxeodHsvcecj42Nmi3yBK5DABi1hbdD/MFQ1I2RJRlo9v105ZjrP9rJn0/rtiUOQ EtrTgHFH7v3TULr2CZ/kUf2blAVzNms6nASlg= 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=whlrVtDSaOPOhU9NB9oN0LR43VRxqEnviBCM+Ekagoo=; b=QBq1P2cYJ8raQACPlo0pWWzBT3BM5UgXReNYRZlKBXya5FIQZTKaHjRcQeCFRNs0CX EFpDFDFbmmVZwhH0BlCbbh/Er8mglsMHUQ7CXUgTWC05dcViPDDUjhT3s3UV8lLJABbL Ucj5G+1kCDg8k6hC+tOdN/kL4iIkhDDO8yCPtros+iU2lSnAoZ2YQhEyTjy4fOqbUSHX WAO2cuBJb8q29jnCsvLbqcdquDspCoiyMzaqf+LLPCwqNC9joKnMRco/RGTShfz+nxO+ sAE6PEKk+FLGv0sp4SM7p7QKdxLlohfiBLuh/WolpVby2LIAkk0NJkoMRFh9KXi8xkTm psvA== X-Gm-Message-State: AOAM533HCSZm7a7xL8DvDnhkINRMs9JXvRgG+gZOEqD4yVdz9lzQJtu2 027ZmR6a1EgVHWxu/zsZr78nOk56jb8q1A== X-Google-Smtp-Source: ABdhPJywWFpHimxRyk3QqrEwt2+XuGWSHfoalPY1iUF3bgYJUHq+YaWvEzFwpFbPQue2lEuCw77MgA== X-Received: by 2002:a05:6a00:1945:b0:44c:a955:35ea with SMTP id s5-20020a056a00194500b0044ca95535eamr20891648pfk.85.1638561350481; Fri, 03 Dec 2021 11:55:50 -0800 (PST) Received: from hiroh2.tok.corp.google.com ([2401:fa00:8f:203:cd78:3a5f:d792:6177]) by smtp.gmail.com with ESMTPSA id t3sm4265891pfj.207.2021.12.03.11.55.49 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 03 Dec 2021 11:55:50 -0800 (PST) From: Hirokazu Honda To: libcamera-devel@lists.libcamera.org Date: Sat, 4 Dec 2021 04:55:35 +0900 Message-Id: <20211203195539.1574621-4-hiroh@chromium.org> X-Mailer: git-send-email 2.34.1.400.ga245620fadb-goog In-Reply-To: <20211203195539.1574621-1-hiroh@chromium.org> References: <20211203195539.1574621-1-hiroh@chromium.org> MIME-Version: 1.0 Subject: [libcamera-devel] [PATCH 3/7] ipa: raspberrypi: awb: Apply clang thread 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 annotates member functions and variables of Awb by clang thread safety annotations. Signed-off-by: Hirokazu Honda --- src/ipa/raspberrypi/controller/rpi/awb.cpp | 2 +- src/ipa/raspberrypi/controller/rpi/awb.hpp | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/ipa/raspberrypi/controller/rpi/awb.cpp b/src/ipa/raspberrypi/controller/rpi/awb.cpp index b4e45abf..ac253d6b 100644 --- a/src/ipa/raspberrypi/controller/rpi/awb.cpp +++ b/src/ipa/raspberrypi/controller/rpi/awb.cpp @@ -318,7 +318,7 @@ void Awb::asyncFunc() while (true) { { MutexLocker lock(mutex_); - async_signal_.wait(lock, [&] { + async_signal_.wait(lock, [&]() LIBCAMERA_TSA_REQUIRES(mutex_) { return async_start_ || async_abort_; }); async_start_ = false; diff --git a/src/ipa/raspberrypi/controller/rpi/awb.hpp b/src/ipa/raspberrypi/controller/rpi/awb.hpp index 30f39c4a..413e0439 100644 --- a/src/ipa/raspberrypi/controller/rpi/awb.hpp +++ b/src/ipa/raspberrypi/controller/rpi/awb.hpp @@ -114,11 +114,11 @@ private: // condvar for synchronous thread to wait on libcamera::ConditionVariable sync_signal_; // for sync thread to check if async thread finished (requires mutex) - bool async_finished_; + bool async_finished_ LIBCAMERA_TSA_GUARDED_BY(mutex_); // for async thread to check if it's been told to run (requires mutex) - bool async_start_; + bool async_start_ LIBCAMERA_TSA_GUARDED_BY(mutex_); // for async thread to check if it's been told to quit (requires mutex) - bool async_abort_; + bool async_abort_ LIBCAMERA_TSA_GUARDED_BY(mutex_); // The following are only for the synchronous thread to use: // for sync thread to note its has asked async thread to run @@ -133,7 +133,7 @@ private: // thread can set/reset them if the async thread is known to be idle: void restartAsync(StatisticsPtr &stats, double lux); // copy out the results from the async thread so that it can be restarted - void fetchAsyncResults(); + void fetchAsyncResults() LIBCAMERA_TSA_REQUIRES(mutex_); StatisticsPtr statistics_; AwbMode *mode_; double lux_;