From patchwork Thu Oct 27 05:55:07 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: 17693 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 9F043C3285 for ; Thu, 27 Oct 2022 05:55:29 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id B91A762F80; Thu, 27 Oct 2022 07:55:28 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=libcamera.org; s=mail; t=1666850128; 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=quU7Qa0F8NHbKQWFL1cLWGXBezMQLTDVFH3ddhnsuXXsTIEJ2ZBDCFGbcWDaG6neh HQoDRhZ5dLxBKXIqFcbBP4NrVrDdnJ38Mm7Ccr3oa0p7U2rId0umhe1rUuXNYVquSG OIqrjjelyNAX1pNiX/wGJBt0TufmDK6+MmxZHP8BZO9NFnHopwbpgAnSKS2OSaIGWP eYKjWUOlq+SUwG74xgCt4NplfvEWjfY9bah+FSLfZiLHP6JVAhPzwKBtqtSo2mvaqZ I4YSbq2w0Oscpx85eu56CJ00+65QoK/FYk25GvDIcbIGek8wVIkDyN518xm49Z9v8M MIDk5ezUins2Q== Received: from mail-oa1-x2c.google.com (mail-oa1-x2c.google.com [IPv6:2001:4860:4864:20::2c]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id C41F962F6B for ; Thu, 27 Oct 2022 07:55:24 +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="Bf4GV9xG"; dkim-atps=neutral Received: by mail-oa1-x2c.google.com with SMTP id 586e51a60fabf-13ae8117023so660858fac.9 for ; Wed, 26 Oct 2022 22:55:24 -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=Bf4GV9xG/qrz8/23P//8aPQlcFELp8dRWUEFC2JvZDeXacbtfIP54cT8aMjZNXcFkF ufMRHfYPqaNWHvZTKEJDFgkTG6rn9rwnSaAutE0liLsYNkHwUXgV2e4QcaSI0FctZqmW IqUbmuaktmJyTXe9LnJK5rOjEPvlpetraSHiCw9F+2jOSJGk0BqPtHYKebOiTulXZcOQ 6Sd0CSPTtmpLkglI16OBPlPRm+Z9Hsta7PvomQRYVSrcXtjr3TGf7Sk8bd4KswxQ+kCU 98QyiG80kClWJUhxTJeysbTu3Z+olNnlqsyYoc+c3/cG6ttd2zAAsR+5EfmwAp6rezc7 PXeA== 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=xZQQ1y6PcEIVdauVCgo68rloeCZzuOdmfOibJNm8yguHt0JURKnB90XXqzgdKVw4G9 GVmXohQ7XM1ZzDAacFUGV5bYJJUWB5+UMGUyTN3QmfOm7sc0S79zoLzbprJmMb2KGwSx Gekh8NNEQwfZPpmXtf8W+Htb0uhZNdig5DylArQARj3hhzwvdszFd4xD25jTUfanFg3l INLXpePY+zMV3QGE7aM6iLPnYESmukGu8coZqfEXSjcy8vk9AjRAB1+4Y4vkrFB6gIXC Ak7wN8SNyluEplSWlodAb2I+rpilPmlx/H178EyDjcmOd1JcqvOs/yn1x3J61h+47SCK 4p5w== X-Gm-Message-State: ACrzQf231/UHL7zIlpJlMefJW5G9MmTpbGhVhpDBllLbg4/1DuL1oCrv mbRwd9YwrGi5bXvbip1Wr/5C5sNeBs4UDmy+ X-Google-Smtp-Source: AMsMyM6qLiY3YRUr5+42z1PnYxpzwgVtlWGuTOKYn2cXSSxea6AAOsZ6rZCFXbarOQYczA86m72wMQ== X-Received: by 2002:a05:6870:14cc:b0:132:8901:7cb3 with SMTP id l12-20020a05687014cc00b0013289017cb3mr4539871oab.21.1666850123360; Wed, 26 Oct 2022 22:55:23 -0700 (PDT) Received: from nroth-pc.attlocal.net ([2600:1700:20:20c0:6406:fc7a:e46d:1666]) by smtp.gmail.com with ESMTPSA id 9-20020a9d0c09000000b00661a05691fasm140021otr.79.2022.10.26.22.55.22 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 26 Oct 2022 22:55:23 -0700 (PDT) To: libcamera-devel@lists.libcamera.org Date: Thu, 27 Oct 2022 00:55:07 -0500 Message-Id: <20221027055515.321791-3-nicholas@rothemail.net> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20221027055515.321791-1-nicholas@rothemail.net> References: <20221027055515.321791-1-nicholas@rothemail.net> MIME-Version: 1.0 Subject: [libcamera-devel] [PATCH 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 --- 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_;