From patchwork Thu Oct 27 22:41:27 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: 17703 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 0E386BDB16 for ; Thu, 27 Oct 2022 22:41:48 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id 3626362FB8; Fri, 28 Oct 2022 00:41:47 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=libcamera.org; s=mail; t=1666910507; 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=TGffDJ2cd8n2aqPuGY6/IdD2lVSIkc2KYoKyUQWkzkKjxb6L6aKdC2U7HVLn7+v79 MqPEUqMmVRNMTQPGHoNdUy/DgEHSZ79/g+n60yBSW051riiJlB/5C9HZuu/3Zpa0p8 BYaOrQ92YbZjsL+wBU9/+NGOJ7azBEnf4CU6nFLeBTFdcwgh+bdmvKOh2Zg0besW1d Ut5W2izVFZLqI+ZADbS/eGpx8ANQiBBzWf7zE583p67Zu/Ovnw3KxmcRORST84E7JP FETCAeKAR82nja5zfV1CpkJZxu0om56rWK/qb8Gp8WTudHrym3ki1zQMPAVdmeH+JS i0Wu1WgrFx67A== Received: from mail-oa1-x2e.google.com (mail-oa1-x2e.google.com [IPv6:2001:4860:4864:20::2e]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id 0D82662FA8 for ; Fri, 28 Oct 2022 00:41:43 +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="c9iPnv3W"; dkim-atps=neutral Received: by mail-oa1-x2e.google.com with SMTP id 586e51a60fabf-13bef14ea06so4322320fac.3 for ; Thu, 27 Oct 2022 15:41:42 -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=c9iPnv3WYXQFSPA33nYoivkAtOyZkZjHh4QDF3SqBgaiWbkSJYjQO9pUxPSTcUajy0 x44adP9J4+xaHSskrIcSKJUwqgeI3caZ3EN60s7bIGI/tEbq34V4hMs+6QJw7D1shISC KIBpCCu0CzuJ9gKsAfpacaoPRKWLI0Fxd4vdO1qbeAI4XbOr0XsdKkrnV1PE24axXvt8 MCiA2GEuI5y2E7adMZ/nIXMTYEhE3yx0USZbN8b+AGX9J3+zZCDFPAhnLZwJiOGDnTbh DOtb+IX4qLZD0kaTqBWEWnnBDbbf8UE8SvKGZpnXv6a1Iivi8aJvU0VWHyu4AbNR/dBG eAzA== 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=4JpUKoUQhMyEB5/x3K7mVBo5zwJU8602IMM5PfIueCxW49v4jm0vbK1qKfyJfDf8sL zvK5bWfPRMCb1zD0bH6LliFV6vQ6dgVFmQcSvDmeCEObzjpdmR5rxQjXCsiMP7J0dbNv SIuLAB+UwxbWruV7l05xPtreDrNwWLmOis7N451iWcGpCpRfrET6hDJq1ICKBlK+6yIL gYqdqtDWUY2Ajn97HIJbdDlL8l+HQz5Q+QCojb/ZwxBA3oWa3k6dvSeFvTb5sos6iFvj Bes/PrFypS884Hp4baiIaDnLEUxwhXN94xoYLcKKAoVY9F1fq38bsqJDzMbZutZLnX9l G6Rg== X-Gm-Message-State: ACrzQf20IUuxM2REwZNi8KFAcxcVApeVOylkzh1ZBnd0QjFTndZGmn4c esT+tycF5o8Rj/S+NpFc69qew99LElYGg6hw X-Google-Smtp-Source: AMsMyM6gmCMXwHt27z0L480YZF3uBN9Ce4tj/vVy8c1PECe9cHcGcXYeiZc25YvkFRbcZmnaqgRI0w== X-Received: by 2002:a05:6871:1d3:b0:136:b0e6:de65 with SMTP id q19-20020a05687101d300b00136b0e6de65mr7169331oad.41.1666910501524; Thu, 27 Oct 2022 15:41:41 -0700 (PDT) Received: from nroth-pc.attlocal.net ([2600:1700:20:20c0:6a4b:7aa7:dda2:75cb]) by smtp.gmail.com with ESMTPSA id r20-20020a056830419400b006619533d1ddsm976825otu.76.2022.10.27.15.41.40 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 27 Oct 2022 15:41:41 -0700 (PDT) To: libcamera-devel@lists.libcamera.org Date: Thu, 27 Oct 2022 17:41:27 -0500 Message-Id: <20221027224135.348115-3-nicholas@rothemail.net> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20221027224135.348115-1-nicholas@rothemail.net> References: <20221027224135.348115-1-nicholas@rothemail.net> MIME-Version: 1.0 Subject: [libcamera-devel] [PATCH v4 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 --- 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_;