summaryrefslogtreecommitdiff
path: root/src/v4l2/v4l2_camera.cpp
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.cpp
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.cpp')
-rw-r--r--src/v4l2/v4l2_camera.cpp5
1 files changed, 2 insertions, 3 deletions
diff --git a/src/v4l2/v4l2_camera.cpp b/src/v4l2/v4l2_camera.cpp
index e922b9e6..7b97c2d5 100644
--- a/src/v4l2/v4l2_camera.cpp
+++ b/src/v4l2/v4l2_camera.cpp
@@ -71,11 +71,10 @@ std::vector<V4L2Camera::Buffer> V4L2Camera::completedBuffers()
{
std::vector<Buffer> v;
- bufferLock_.lock();
+ MutexLocker lock(bufferLock_);
for (std::unique_ptr<Buffer> &metadata : completedBuffers_)
v.push_back(*metadata.get());
completedBuffers_.clear();
- bufferLock_.unlock();
return v;
}
@@ -278,7 +277,7 @@ int V4L2Camera::qbuf(unsigned int index)
void V4L2Camera::waitForBufferAvailable()
{
MutexLocker locker(bufferMutex_);
- bufferCV_.wait(locker, [&] {
+ bufferCV_.wait(locker, [&]() LIBCAMERA_TSA_REQUIRES(bufferMutex_) {
return bufferAvailableCount_ >= 1 || !isRunning_;
});
if (isRunning_)