From patchwork Mon Oct 24 05:55:34 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: 17678 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 442BBBD16B for ; Mon, 24 Oct 2022 05:55:56 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id 09A7562EF2; Mon, 24 Oct 2022 07:55:56 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=libcamera.org; s=mail; t=1666590956; bh=rteEdorfeYf2WMIU0zZHBkRaXqRJ5MwkQvm/TECYYCs=; 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=2Mgd0vd+MvrZP1nyzaTVdl0dFkxvx/4XZnl8bVNZbH37r/v6wV8mABxei08chhlgV OM4arKksr6mti/yd/o+BVUYgUv5kPznMUnJz83RsirrXtFVzpURGh9jU6hvc+kiCy7 ryUBKY9n580W839NGyvekjmSqoSrX50qfZCXG1LCab9yZu+APSL9kvYSjYNm7q7jnR jtD3G1xYpAT8vl2HOdWRCdXlXAEmC6eCIfsdUwrm7VJ+tjJWmfyKoNowGyPgqaIPt2 +Aog7WDy1oJpkr4+mUnUW54o5GOiRkbMs9QhEIUMzdzBBeQdskCgRD1u7WffJhQZxp x4PV7+yvKBloQ== Received: from mail-ot1-x331.google.com (mail-ot1-x331.google.com [IPv6:2607:f8b0:4864:20::331]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id 8883461F4C for ; Mon, 24 Oct 2022 07:55:54 +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="KZX0qYAO"; dkim-atps=neutral Received: by mail-ot1-x331.google.com with SMTP id r13-20020a056830418d00b0065601df69c0so5363192otu.7 for ; Sun, 23 Oct 2022 22:55:54 -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=S/Zpa27nkzDhV6rhVl67Z8VoZFYssjvzoo5aGuTsmsE=; b=KZX0qYAOV4nsyCzVY6akCOrm/uWIOoES+2zjVz7YezoYp/JXidFgiVvfOu5+/jxNNC qS1mo89WQQeENw09x2RzIJOGknW4D1cwf7ONnkYBllOjlbzbNDR+O0iLi9CngahVQTbb 7DJFRPzmEPnxFroF5bhRVTwD8Cu7xAsBhbI0DEmxF3UxDYmCQFoTw2MqD3czOX7ELKGA m5f6CHTH9HVFwjb0bCMtfHtXHuhqcu3qL7PJtIdsbNPG/EcugFbdZUn4YLcWTiMAFfZk d39RYGV9yoB8qYSoaYzcRpE4/5pwZid2WZTXzEWhFS9s1N9z+mvsssSeXebeRaphWYog OfGg== 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=S/Zpa27nkzDhV6rhVl67Z8VoZFYssjvzoo5aGuTsmsE=; b=pKFQbQSaxmJZ7zA1/gaj4TY8izBK4wLAFZbjN+0sYtfr1vXW1IUYae4+0r9x5Oxu4R eAyWclsGyu821jUEdQ9mZZ8GGFuCNW+mRCp4n9QaiLgOKo+u2glCcGMYnqI5mmFF5qme lKbIYKklvkP/lCo+/68E0OUwZJN/45ABwagLNuGVu2PB98P9rkhS4o69HJ/d6Ez7aUb7 s7efsIxbqdh7OSYsubcqGnnYDkpiuADoRSYPIdZxxC/4vanJhpF+lg1pBaM3DMq2nE89 geZ4zEPbGPBJ8azgAZw+dmJ1l0vsXqx9ED2vIbh27yHAbyrgTpjSvwgFgd7u3GX2cKm3 7lWg== X-Gm-Message-State: ACrzQf0n2eMipya00LcII8wxSPcCXF826f+sLawmdD4Mlsa20zPoVeGr 964McoCgedEL7uYzxEP5gzwXsJcEXUNT+I8R X-Google-Smtp-Source: AMsMyM538Dc5FqnVrRhivifgZp5ZtDhXNUz7EzgknWGV26PHI5Lv39sdk0HKR7W7gGQ0DzQg+wlexw== X-Received: by 2002:a05:6830:16c7:b0:661:b465:6e1e with SMTP id l7-20020a05683016c700b00661b4656e1emr15675370otr.124.1666590952599; Sun, 23 Oct 2022 22:55:52 -0700 (PDT) Received: from nroth-pc.attlocal.net ([2600:1700:20:20c0:7bc3:aed3:676f:10a0]) by smtp.gmail.com with ESMTPSA id x15-20020a9d628f000000b0066193df8edasm3980278otk.34.2022.10.23.22.55.52 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 23 Oct 2022 22:55:52 -0700 (PDT) To: libcamera-devel@lists.libcamera.org Date: Mon, 24 Oct 2022 00:55:34 -0500 Message-Id: <20221024055543.116040-3-nicholas@rothemail.net> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20221024055543.116040-1-nicholas@rothemail.net> References: <20221024055543.116040-1-nicholas@rothemail.net> MIME-Version: 1.0 Subject: [libcamera-devel] [PATCH 02/11] Adds missing thread-safety annotations, lack of which break the build. 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 ../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(); } ^ --- 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_;