[libcamera-devel,v5,12/12] android: camera_request: Add thread safety annotation
diff mbox series

Message ID 20211201075348.3121186-13-hiroh@chromium.org
State Accepted
Headers show
Series
  • Introduce clang thread safety annotations
Related show

Commit Message

Hirokazu Honda Dec. 1, 2021, 7:53 a.m. UTC
This applies clang thread safety annotation to
Camera3RequestDescriptor.

Signed-off-by: Hirokazu Honda <hiroh@chromium.org>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
---
 src/android/camera_request.h | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

Comments

Umang Jain Dec. 1, 2021, 10:36 a.m. UTC | #1
Hi Hiro,


On 12/1/21 1:23 PM, Hirokazu Honda wrote:
> This applies clang thread safety annotation to
> Camera3RequestDescriptor.
>
> Signed-off-by: Hirokazu Honda <hiroh@chromium.org>
> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>


Reviewed-by: Umang Jain <umang.jain@ideasonboard.com>

> ---
>   src/android/camera_request.h | 3 ++-
>   1 file changed, 2 insertions(+), 1 deletion(-)
>
> diff --git a/src/android/camera_request.h b/src/android/camera_request.h
> index 887dbe86..d9b04f16 100644
> --- a/src/android/camera_request.h
> +++ b/src/android/camera_request.h
> @@ -57,7 +57,8 @@ public:
>   	};
>   
>   	/* Keeps track of streams requiring post-processing. */
> -	std::map<CameraStream *, StreamBuffer *> pendingStreamsToProcess_;
> +	std::map<CameraStream *, StreamBuffer *> pendingStreamsToProcess_
> +		LIBCAMERA_TSA_GUARDED_BY(streamsProcessMutex_);
>   	libcamera::Mutex streamsProcessMutex_;
>   
>   	Camera3RequestDescriptor(libcamera::Camera *camera,

Patch
diff mbox series

diff --git a/src/android/camera_request.h b/src/android/camera_request.h
index 887dbe86..d9b04f16 100644
--- a/src/android/camera_request.h
+++ b/src/android/camera_request.h
@@ -57,7 +57,8 @@  public:
 	};
 
 	/* Keeps track of streams requiring post-processing. */
-	std::map<CameraStream *, StreamBuffer *> pendingStreamsToProcess_;
+	std::map<CameraStream *, StreamBuffer *> pendingStreamsToProcess_
+		LIBCAMERA_TSA_GUARDED_BY(streamsProcessMutex_);
 	libcamera::Mutex streamsProcessMutex_;
 
 	Camera3RequestDescriptor(libcamera::Camera *camera,