{"id":14933,"url":"https://patchwork.libcamera.org/api/1.1/patches/14933/?format=json","web_url":"https://patchwork.libcamera.org/patch/14933/","project":{"id":1,"url":"https://patchwork.libcamera.org/api/1.1/projects/1/?format=json","name":"libcamera","link_name":"libcamera","list_id":"libcamera_core","list_email":"libcamera-devel@lists.libcamera.org","web_url":"","scm_url":"","webscm_url":""},"msgid":"<20211201070728.3114247-8-hiroh@chromium.org>","date":"2021-12-01T07:07:23","name":"[libcamera-devel,v4,07/12] android: camera_hal_manager: Add thread safety annotation","commit_ref":null,"pull_url":null,"state":"superseded","archived":false,"hash":"c6bd61088a96f9f5edc0f342aba6cfef9c9a68fd","submitter":{"id":63,"url":"https://patchwork.libcamera.org/api/1.1/people/63/?format=json","name":"Hirokazu Honda","email":"hiroh@chromium.org"},"delegate":null,"mbox":"https://patchwork.libcamera.org/patch/14933/mbox/","series":[{"id":2789,"url":"https://patchwork.libcamera.org/api/1.1/series/2789/?format=json","web_url":"https://patchwork.libcamera.org/project/libcamera/list/?series=2789","date":"2021-12-01T07:07:16","name":"Introduce clang thread safety annotations","version":4,"mbox":"https://patchwork.libcamera.org/series/2789/mbox/"}],"comments":"https://patchwork.libcamera.org/api/patches/14933/comments/","check":"pending","checks":"https://patchwork.libcamera.org/api/patches/14933/checks/","tags":{},"headers":{"Return-Path":"<libcamera-devel-bounces@lists.libcamera.org>","X-Original-To":"parsemail@patchwork.libcamera.org","Delivered-To":"parsemail@patchwork.libcamera.org","Received":["from lancelot.ideasonboard.com (lancelot.ideasonboard.com\n\t[92.243.16.209])\n\tby patchwork.libcamera.org (Postfix) with ESMTPS id AD057C324F\n\tfor <parsemail@patchwork.libcamera.org>;\n\tWed,  1 Dec 2021 07:07:50 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 583B760725;\n\tWed,  1 Dec 2021 08:07:50 +0100 (CET)","from mail-pf1-x432.google.com (mail-pf1-x432.google.com\n\t[IPv6:2607:f8b0:4864:20::432])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 6657E6072E\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tWed,  1 Dec 2021 08:07:48 +0100 (CET)","by mail-pf1-x432.google.com with SMTP id 8so23411477pfo.4\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tTue, 30 Nov 2021 23:07:48 -0800 (PST)","from hiroh2.tok.corp.google.com\n\t([2401:fa00:8f:203:3892:a049:59ba:c772])\n\tby smtp.gmail.com with ESMTPSA id\n\tm10sm16598962pgv.75.2021.11.30.23.07.45\n\t(version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);\n\tTue, 30 Nov 2021 23:07:46 -0800 (PST)"],"Authentication-Results":"lancelot.ideasonboard.com;\n\tdkim=fail reason=\"signature verification failed\" (1024-bit key;\n\tunprotected) header.d=chromium.org header.i=@chromium.org\n\theader.b=\"B++QrKmb\"; dkim-atps=neutral","DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org;\n\ts=google; \n\th=from:to:cc:subject:date:message-id:in-reply-to:references\n\t:mime-version:content-transfer-encoding;\n\tbh=yfiTHE7WZmDZfQa0nPUIu56mr46Z/OnMWR39IqW4+bk=;\n\tb=B++QrKmbwh/n3+MYOLw/l5+RbHh2JYli/K5Z8O0Z53ck9Wa72Ym6zkZq4lZcAke2Rb\n\tCJeN1UqZg4ObotEhYmXqymUTb+4t6A7FkaWIgAhxRAvk2UvtazkwYXOMR7BRPyTBduqX\n\tsV81cOh6fjNbWaF/PKpUSmx4Jnkk1ePsLKEsI=","X-Google-DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=1e100.net; s=20210112;\n\th=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to\n\t:references:mime-version:content-transfer-encoding;\n\tbh=yfiTHE7WZmDZfQa0nPUIu56mr46Z/OnMWR39IqW4+bk=;\n\tb=asKIY/A8XJdpTnV/k27ESXw/iN5edsdyNX+UWL6mAjFlJDEbaormB2zNkSF5MD/xIs\n\tP/3imD6I8z2QeHo2+Fv7ylk532Nj4x/dVWT6Z8t4vvuUjfV+y0KNLTFz86GiY52ZVsVr\n\tvhs3vzJN4xXMGI2DRQaA5DaC2f4TuWgxZ0e1Xy0nEUtY9i2nAoIWC5Mt9pJPf/kldTD4\n\tMDrxFUUo9w9RD+ib/ywt6/MNhow5iiyLFRrY7uLredwoHeGN8SAZlKMIRSS7V9RCwaTE\n\tye+N9utEkshu5nabH36kDub1fzBYuPJL3fOGc59PexGbp4sdMASswKVctYRXApEFlt47\n\tiZDQ==","X-Gm-Message-State":"AOAM5300ZUlKZzpWx+6VndlGhmavXxPDTfdOm5vPHrr4p0IGcZH1gRL3\n\tPYaX7NPtyPiK9JchFQ9FX2t3t6IqM91GjQ==","X-Google-Smtp-Source":"ABdhPJzUz81gVE+/ViZRx3TsxxCzPAl/k53F0wDEmMEnb1WryEhCkxGgVWw5GthUsZpxI5dagcV8kg==","X-Received":"by 2002:a63:155f:: with SMTP id 31mr3358972pgv.156.1638342466735;\n\tTue, 30 Nov 2021 23:07:46 -0800 (PST)","From":"Hirokazu Honda <hiroh@chromium.org>","To":"libcamera-devel@lists.libcamera.org","Date":"Wed,  1 Dec 2021 16:07:23 +0900","Message-Id":"<20211201070728.3114247-8-hiroh@chromium.org>","X-Mailer":"git-send-email 2.34.0.rc2.393.gf8c9666880-goog","In-Reply-To":"<20211201070728.3114247-1-hiroh@chromium.org>","References":"<20211201070728.3114247-1-hiroh@chromium.org>","MIME-Version":"1.0","Content-Transfer-Encoding":"8bit","Subject":"[libcamera-devel] [PATCH v4 07/12] android: camera_hal_manager: Add\n\tthread safety annotation","X-BeenThere":"libcamera-devel@lists.libcamera.org","X-Mailman-Version":"2.1.29","Precedence":"list","List-Id":"<libcamera-devel.lists.libcamera.org>","List-Unsubscribe":"<https://lists.libcamera.org/options/libcamera-devel>,\n\t<mailto:libcamera-devel-request@lists.libcamera.org?subject=unsubscribe>","List-Archive":"<https://lists.libcamera.org/pipermail/libcamera-devel/>","List-Post":"<mailto:libcamera-devel@lists.libcamera.org>","List-Help":"<mailto:libcamera-devel-request@lists.libcamera.org?subject=help>","List-Subscribe":"<https://lists.libcamera.org/listinfo/libcamera-devel>,\n\t<mailto:libcamera-devel-request@lists.libcamera.org?subject=subscribe>","Errors-To":"libcamera-devel-bounces@lists.libcamera.org","Sender":"\"libcamera-devel\" <libcamera-devel-bounces@lists.libcamera.org>"},"content":"This applies clang thread safety annotation to CameraHalManager.\n\nSigned-off-by: Hirokazu Honda <hiroh@chromium.org>\nReviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>\nReviewed-by: Umang Jain <umang.jain@ideasonboard.com>\n---\n src/android/camera_hal_manager.h | 6 +++---\n 1 file changed, 3 insertions(+), 3 deletions(-)","diff":"diff --git a/src/android/camera_hal_manager.h b/src/android/camera_hal_manager.h\nindex 765701b2..a5f8b933 100644\n--- a/src/android/camera_hal_manager.h\n+++ b/src/android/camera_hal_manager.h\n@@ -53,14 +53,14 @@ private:\n \tvoid cameraAdded(std::shared_ptr<libcamera::Camera> cam);\n \tvoid cameraRemoved(std::shared_ptr<libcamera::Camera> cam);\n \n-\tCameraDevice *cameraDeviceFromHalId(unsigned int id);\n+\tCameraDevice *cameraDeviceFromHalId(unsigned int id) LIBCAMERA_TSA_REQUIRES(mutex_);\n \n \tstd::unique_ptr<libcamera::CameraManager> cameraManager_;\n \tCameraHalConfig halConfig_;\n \n \tconst camera_module_callbacks_t *callbacks_;\n-\tstd::vector<std::unique_ptr<CameraDevice>> cameras_;\n-\tstd::map<std::string, unsigned int> cameraIdsMap_;\n+\tstd::vector<std::unique_ptr<CameraDevice>> cameras_ LIBCAMERA_TSA_GUARDED_BY(mutex_);\n+\tstd::map<std::string, unsigned int> cameraIdsMap_ LIBCAMERA_TSA_GUARDED_BY(mutex_);\n \tlibcamera::Mutex mutex_;\n \n \tunsigned int numInternalCameras_;\n","prefixes":["libcamera-devel","v4","07/12"]}