summaryrefslogtreecommitdiff
path: root/src/v4l2/v4l2_camera.h
diff options
context:
space:
mode:
authorHirokazu Honda <hiroh@chromium.org>2022-11-03 18:50:41 +0530
committerUmang Jain <umang.jain@ideasonboard.com>2022-11-11 16:25:47 +0530
commit86735b12ec60567c12305a5231d0aeb3fae218fc (patch)
treef7eaeb4c6d5f16e53dce83e43aef9962281e35a5 /src/v4l2/v4l2_camera.h
parent0efb2c17c19e1867fd1c9df18f26b14a8d62c7ac (diff)
v4l2: v4l2_camera: Apply clang thread safety annotation
This annotates member functions and variables of V4L2Camera by clang thread safety annotations. Signed-off-by: Hirokazu Honda <hiroh@chromium.org> Signed-off-by: Umang Jain <umang.jain@ideasonboard.com> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Reviewed-by: Umang Jain <umang.jain@ideasonboard.com>
Diffstat (limited to 'src/v4l2/v4l2_camera.h')
-rw-r--r--src/v4l2/v4l2_camera.h14
1 files changed, 8 insertions, 6 deletions
diff --git a/src/v4l2/v4l2_camera.h b/src/v4l2/v4l2_camera.h
index 03e74118..d3483444 100644
--- a/src/v4l2/v4l2_camera.h
+++ b/src/v4l2/v4l2_camera.h
@@ -39,7 +39,7 @@ public:
void bind(int efd);
void unbind();
- std::vector<Buffer> completedBuffers();
+ std::vector<Buffer> completedBuffers() LIBCAMERA_TSA_EXCLUDES(bufferLock_);
int configure(libcamera::StreamConfiguration *streamConfigOut,
const libcamera::Size &size,
@@ -58,13 +58,14 @@ public:
int qbuf(unsigned int index);
- void waitForBufferAvailable();
- bool isBufferAvailable();
+ void waitForBufferAvailable() LIBCAMERA_TSA_EXCLUDES(bufferMutex_);
+ bool isBufferAvailable() LIBCAMERA_TSA_EXCLUDES(bufferMutex_);
bool isRunning();
private:
- void requestComplete(libcamera::Request *request);
+ void requestComplete(libcamera::Request *request)
+ LIBCAMERA_TSA_EXCLUDES(bufferLock_);
std::shared_ptr<libcamera::Camera> camera_;
std::unique_ptr<libcamera::CameraConfiguration> config_;
@@ -77,11 +78,12 @@ private:
std::vector<std::unique_ptr<libcamera::Request>> requestPool_;
std::deque<libcamera::Request *> pendingRequests_;
- std::deque<std::unique_ptr<Buffer>> completedBuffers_;
+ std::deque<std::unique_ptr<Buffer>> completedBuffers_
+ LIBCAMERA_TSA_GUARDED_BY(bufferLock_);
int efd_;
libcamera::Mutex bufferMutex_;
libcamera::ConditionVariable bufferCV_;
- unsigned int bufferAvailableCount_;
+ unsigned int bufferAvailableCount_ LIBCAMERA_TSA_GUARDED_BY(bufferMutex_);
};