{"id":14847,"url":"https://patchwork.libcamera.org/api/patches/14847/?format=json","web_url":"https://patchwork.libcamera.org/patch/14847/","project":{"id":1,"url":"https://patchwork.libcamera.org/api/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":"<20211129114453.3186042-12-hiroh@chromium.org>","date":"2021-11-29T11:44:53","name":"[libcamera-devel,v2,11/11] android: camera_request: Add thread safety annotation","commit_ref":null,"pull_url":null,"state":"superseded","archived":false,"hash":"6b5c178aababe8dac45b37b63bcfb682b0b5a5ad","submitter":{"id":63,"url":"https://patchwork.libcamera.org/api/people/63/?format=json","name":"Hirokazu Honda","email":"hiroh@chromium.org"},"delegate":null,"mbox":"https://patchwork.libcamera.org/patch/14847/mbox/","series":[{"id":2770,"url":"https://patchwork.libcamera.org/api/series/2770/?format=json","web_url":"https://patchwork.libcamera.org/project/libcamera/list/?series=2770","date":"2021-11-29T11:44:42","name":"Introduce clang thread safety annotations","version":2,"mbox":"https://patchwork.libcamera.org/series/2770/mbox/"}],"comments":"https://patchwork.libcamera.org/api/patches/14847/comments/","check":"pending","checks":"https://patchwork.libcamera.org/api/patches/14847/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 B6FF3BF415\n\tfor <parsemail@patchwork.libcamera.org>;\n\tMon, 29 Nov 2021 11:45:24 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 6E7FF605A5;\n\tMon, 29 Nov 2021 12:45:24 +0100 (CET)","from mail-pg1-x529.google.com (mail-pg1-x529.google.com\n\t[IPv6:2607:f8b0:4864:20::529])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 90402605BC\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tMon, 29 Nov 2021 12:45:20 +0100 (CET)","by mail-pg1-x529.google.com with SMTP id r5so15782268pgi.6\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tMon, 29 Nov 2021 03:45:20 -0800 (PST)","from hiroh2.tok.corp.google.com\n\t([2401:fa00:8f:203:f254:cda9:46e8:17b7])\n\tby smtp.gmail.com with ESMTPSA id\n\thg4sm17951966pjb.1.2021.11.29.03.45.17\n\t(version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);\n\tMon, 29 Nov 2021 03:45:18 -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=\"iqw5Ia1h\"; 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=JedrOwQA5kD3N95srlI/iWKZv5HXuMwvL92/B73i6ws=;\n\tb=iqw5Ia1hIfxXBuAIRIfkIv+szDpJ1CELjvJBSehHFECNUWpKeIPmY8GP406VXqQJA0\n\tW55yMgO4Gj1xEOJUGMyng0IqNxC6fS5DdS8CkyF1nSjaDYYfqWiRfF/ZRtiMBrjtV+to\n\tef+U7AymzWl84Ril3haDf9S/oyHpIiBNUSylg=","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=JedrOwQA5kD3N95srlI/iWKZv5HXuMwvL92/B73i6ws=;\n\tb=Q5l5BLI9miqTFZZsO8fEmY10Hv+8y1llF6z5yLsesaA7e6j7ahxGa8++WpDOU64/jP\n\t2gHMq9ixdWEMowSGGsjInUFP/Z9pq6dq26VLciTKMsV0oIQ6TJJ6t1a7FIKz7cIvuKm2\n\tS0X6z0yN7Phq6088hG2gP2nyk1WUYBRk8YODO6ySX6DWtepv+gjBygrXDbetHecVNIjw\n\tVh0Wc7083llYbgBTMLRWge88tCaUHQ49oIWwsf62ymXPBx6nnrX9prNBTKHyIfpwvJHO\n\t0OOLqOD3/8qp7x5ZS2hcQHLs4Uj4JfkteRjZdCPfgJDhHEewUkPE6W18AfYxjMQzyDew\n\tHL7w==","X-Gm-Message-State":"AOAM533XLJ5BfPOXsja7bYGlL3SaiaEM60R0oO1DQbRXPhUyaMXBRnM6\n\tf4gOskZENNHE6GwpKSHMqyxuER5q/bQm4w==","X-Google-Smtp-Source":"ABdhPJxHLDgAWYV3szmQO+O1XR8VdQ2FTgRu0Fb2OGCFy8XD2Qj5j6gVkgDvK1MTWclqhUAi6UWwoQ==","X-Received":"by 2002:a05:6a00:17a4:b0:49f:c0c0:3263 with SMTP id\n\ts36-20020a056a0017a400b0049fc0c03263mr39278900pfg.81.1638186318944; \n\tMon, 29 Nov 2021 03:45:18 -0800 (PST)","From":"Hirokazu Honda <hiroh@chromium.org>","To":"libcamera-devel@lists.libcamera.org","Date":"Mon, 29 Nov 2021 20:44:53 +0900","Message-Id":"<20211129114453.3186042-12-hiroh@chromium.org>","X-Mailer":"git-send-email 2.34.0.rc2.393.gf8c9666880-goog","In-Reply-To":"<20211129114453.3186042-1-hiroh@chromium.org>","References":"<20211129114453.3186042-1-hiroh@chromium.org>","MIME-Version":"1.0","Content-Transfer-Encoding":"8bit","Subject":"[libcamera-devel] [PATCH v2 11/11] android: camera_request: 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\nCamera3RequestDescriptor. Mutex and MutexLocker there are\nreplaced with Mutex2 and MutexLocer2.\n\nSigned-off-by: Hirokazu Honda <hiroh@chromium.org>\nReviewed-by: Umang Jain <umang.jain@ideasonboard.com>\n---\n src/android/camera_request.h | 6 ++++--\n 1 file changed, 4 insertions(+), 2 deletions(-)","diff":"diff --git a/src/android/camera_request.h b/src/android/camera_request.h\nindex 88d501a8..dfdc3324 100644\n--- a/src/android/camera_request.h\n+++ b/src/android/camera_request.h\n@@ -12,7 +12,8 @@\n #include <vector>\n \n #include <libcamera/base/class.h>\n-#include <libcamera/base/thread.h>\n+#include <libcamera/base/mutex.h>\n+#include <libcamera/base/thread_annotations.h>\n \n #include <libcamera/camera.h>\n #include <libcamera/framebuffer.h>\n@@ -57,7 +58,8 @@ public:\n \t};\n \n \t/* Keeps track of streams requiring post-processing. */\n-\tstd::map<CameraStream *, StreamBuffer *> pendingStreamsToProcess_;\n+\tstd::map<CameraStream *, StreamBuffer *> pendingStreamsToProcess_\n+\t\tLIBCAMERA_TSA_GUARDED_BY(streamsProcessMutex_);\n \tlibcamera::Mutex streamsProcessMutex_;\n \n \tCamera3RequestDescriptor(libcamera::Camera *camera,\n","prefixes":["libcamera-devel","v2","11/11"]}