[libcamera-devel,6/7] v4l2: v4l2_camera_proxy: Apply clang thread safety annotation
diff mbox series

Message ID 20211203164619.1541033-7-hiroh@chromium.org
State Accepted
Headers show
Series
  • Apply clang thread safety annotation libcamera-core and v4l2
Related show

Commit Message

Hirokazu Honda Dec. 3, 2021, 4:46 p.m. UTC
This annotates member functions of V4L2CameraProxy by clang
thread safety annotations.

Signed-off-by: Hirokazu Honda <hiroh@chromium.org>
---
 src/v4l2/v4l2_camera_proxy.h | 14 ++++++++------
 1 file changed, 8 insertions(+), 6 deletions(-)

Patch
diff mbox series

diff --git a/src/v4l2/v4l2_camera_proxy.h b/src/v4l2/v4l2_camera_proxy.h
index fa0a49e0..993562ef 100644
--- a/src/v4l2/v4l2_camera_proxy.h
+++ b/src/v4l2/v4l2_camera_proxy.h
@@ -27,12 +27,14 @@  class V4L2CameraProxy
 public:
 	V4L2CameraProxy(unsigned int index, std::shared_ptr<libcamera::Camera> camera);
 
-	int open(V4L2CameraFile *file);
-	void close(V4L2CameraFile *file);
-	void *mmap(void *addr, size_t length, int prot, int flags, off64_t offset);
-	int munmap(void *addr, size_t length);
-
-	int ioctl(V4L2CameraFile *file, unsigned long request, void *arg);
+	int open(V4L2CameraFile *file) LIBCAMERA_TSA_EXCLUDES(proxyMutex_);
+	void close(V4L2CameraFile *file) LIBCAMERA_TSA_EXCLUDES(proxyMutex_);
+	void *mmap(void *addr, size_t length, int prot, int flags, off64_t offset)
+		LIBCAMERA_TSA_EXCLUDES(proxyMutex_);
+	int munmap(void *addr, size_t length) LIBCAMERA_TSA_EXCLUDES(proxyMutex_);
+
+	int ioctl(V4L2CameraFile *file, unsigned long request, void *arg)
+		LIBCAMERA_TSA_EXCLUDES(proxyMutex_);
 
 private:
 	bool validateBufferType(uint32_t type);