From patchwork Fri Oct 28 03:17:18 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nicolas Dufresne via libcamera-devel X-Patchwork-Id: 17714 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 A943CC3285 for ; Fri, 28 Oct 2022 03:17:37 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id 4767F62FC0; Fri, 28 Oct 2022 05:17:37 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=libcamera.org; s=mail; t=1666927057; bh=17Ukq0I3hqoas+gx0WV6KuuhC12XYREv+g1mUc9xNoQ=; h=To:Date:In-Reply-To:References:Subject:List-Id:List-Unsubscribe: List-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To:Cc: From; b=0V6cMTJvK7a82Kiu67QpdRe9ZNe0/KQgU+Yrx+00HKdihUwNcPoTBETzNDfLp2W7J XCc+ZSCLaPqYIRA/5ZuSIj+VNOngxVQ5CTaFg7K3FkU6+XfmjYyV4YerwSfcPLrMz6 n0A9VTez1pgXt5oWyxyqEw+701PkqclDYn63gexd2y4gY1dYDOHSdQWV427uyN+W15 cVWbaSaFPLnUy1z1p5D0V/06QBAmiTcnN572UMnR7NYGg6FknX3N0lmIxnsrZRZSrl 1qheggzINI7UOBbTZmtFyZ15PW2Bc72+YuwFZANKn9fYFWm1tKxjFZUPI3IRKoaBi8 boj2floaf5LiQ== Received: from mail-oa1-x29.google.com (mail-oa1-x29.google.com [IPv6:2001:4860:4864:20::29]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id C7AB662FA5 for ; Fri, 28 Oct 2022 05:17:32 +0200 (CEST) Authentication-Results: lancelot.ideasonboard.com; dkim=pass (2048-bit key; unprotected) header.d=rothemail-net.20210112.gappssmtp.com header.i=@rothemail-net.20210112.gappssmtp.com header.b="B+2oZXzp"; dkim-atps=neutral Received: by mail-oa1-x29.google.com with SMTP id 586e51a60fabf-13ba9a4430cso4960140fac.11 for ; Thu, 27 Oct 2022 20:17:32 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=rothemail-net.20210112.gappssmtp.com; s=20210112; h=content-transfer-encoding:mime-version:reply-to:references :in-reply-to:message-id:date:subject:cc:to:from:from:to:cc:subject :date:message-id:reply-to; bh=1mfxtU8lTzXIpkx/hUjfyntGA0NGDWGeGZDezQGJzxA=; b=B+2oZXzpxfR3KvDIsb26hBjGDCnit7CK7p5Hn8satZesWBzO1aFioGZhZFeKRKl9MH kmS5zTEHUsZ0NVtz7kwmhWrKt0A+0TF6h9Qj0RedzJ0DcETEkvQ7mM06mts7bkdgbn9V YGU9FK2Sn4AGtzz92x0+mww81TX8/Ktmd8hUkwXq7hJGw78MpnVOJRc9hnuiE0ALy1r1 OMAzbYIDWvYkjprakLi4I+QwyDzkJXM1DnzoviLEvwTHqDd8OvfAAmnDiIICzhOmWDFi Sl62e9AdzA7JmpmGhtZh5wNXZVGCM3BRm1/hChuKUJE84PYoJjGAmqgU21S55HMg9aiq Zl7g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:reply-to:references :in-reply-to:message-id:date:subject:cc:to:from:x-gm-message-state :from:to:cc:subject:date:message-id:reply-to; bh=1mfxtU8lTzXIpkx/hUjfyntGA0NGDWGeGZDezQGJzxA=; b=QsJAXrZxgyQuaF+lkYaIlFHNuXdPzDGgFh0CowfKzebjKbhliiyn3TUskd4WYR7HZt aVURCAcecu8DGQx5FPadqL1KuhjVijXxdAUkak7/EAlCs1qDTD1aoFJ2gGDe0has9CCb O/1jGXjnyEQOZjsMfx9sO11DKLS9jQLjC2V60ISINerSOZjs3qbCMaD1T19/wybVwN6r Pmz0KgU5LFX/itOMxemTmLX8r3qI0NAT9Zr2xxTE5RMOaRAhi83p1r8WWLlOkLsii/2P mBfK/zU14VNiPu040FwP20TDRw57pzJ6Y+fYo7b/SHaN6NSIcJdkge8whsTsgNmlKS5B ofyQ== X-Gm-Message-State: ACrzQf2Qbhscx5u3XShOIFH1DqFaZsSOTe5C7P4fKwCh8kCMOIwgcdJ5 Hdesbws7vhcluno69uNq8mLaMymZnfJJ55kmHWA= X-Google-Smtp-Source: AMsMyM5smXSmKBb8eosTavUrHi/j0tmtR29zuLt7/QwcYbRsG1ualyN+WuL5eWuYxiiBwMRNyawAZA== X-Received: by 2002:a05:6871:b2b:b0:13b:6c86:2f40 with SMTP id fq43-20020a0568710b2b00b0013b6c862f40mr7722202oab.51.1666927051157; Thu, 27 Oct 2022 20:17:31 -0700 (PDT) Received: from nroth-pc.attlocal.net ([2600:1700:20:20c0:293a:90ce:6463:244d]) by smtp.gmail.com with ESMTPSA id fp19-20020a056870659300b0013626c1a5f6sm1527738oab.10.2022.10.27.20.17.30 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 27 Oct 2022 20:17:30 -0700 (PDT) To: libcamera-devel@lists.libcamera.org Date: Thu, 27 Oct 2022 22:17:18 -0500 Message-Id: <20221028031726.4849-3-nicholas@rothemail.net> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20221028031726.4849-1-nicholas@rothemail.net> References: <20221027224135.348115-1-nicholas@rothemail.net> <20221028031726.4849-1-nicholas@rothemail.net> MIME-Version: 1.0 Subject: [libcamera-devel] [PATCH v5 02/10] ipa: add missing thread-safety annotations 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: , X-Patchwork-Original-From: Nicholas Roth via libcamera-devel From: Nicolas Dufresne via libcamera-devel Reply-To: libcamera-devel@lists.libcamera.org Cc: nicholas@rothemail.net Errors-To: libcamera-devel-bounces@lists.libcamera.org Sender: "libcamera-devel" From: Nicholas Roth The raspberrypi IPA is missing thread-safety annotations, which breaks the build. Add required thread-safety annotations. ../src/ipa/raspberrypi/controller/metadata.h:108:31: error: mutex 'mutex_' is still held at the end of function [-Werror,-Wthread-safety-analysis] void lock() { mutex_.lock(); } ^ ../src/ipa/raspberrypi/controller/metadata.h:108:23: note: mutex acquired here void lock() { mutex_.lock(); } ^ ../src/ipa/raspberrypi/controller/metadata.h:109:25: error: releasing mutex 'mutex_' that was not held [-Werror,-Wthread-safety-analysis] void unlock() { mutex_.unlock(); } ^ Signed-off-by: Nicholas Roth Reviewed-by: Jacopo Mondi Reviewed-by: Kieran Bingham Reviewed-by: Naushir Patuck --- src/ipa/raspberrypi/controller/metadata.h | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/ipa/raspberrypi/controller/metadata.h b/src/ipa/raspberrypi/controller/metadata.h index 0f7ebfaf..870b6e26 100644 --- a/src/ipa/raspberrypi/controller/metadata.h +++ b/src/ipa/raspberrypi/controller/metadata.h @@ -13,9 +13,11 @@ #include #include +#include + namespace RPiController { -class Metadata +class LIBCAMERA_TSA_CAPABILITY("mutex") Metadata { public: Metadata() = default; @@ -103,8 +105,8 @@ public: * locks with the standard lock classes. * e.g. std::lock_guard lock(metadata) */ - void lock() { mutex_.lock(); } - void unlock() { mutex_.unlock(); } + void lock() LIBCAMERA_TSA_ACQUIRE() { mutex_.lock(); } + void unlock() LIBCAMERA_TSA_RELEASE() { mutex_.unlock(); } private: mutable std::mutex mutex_;