summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorBarnabás Pőcze <barnabas.pocze@ideasonboard.com>2025-03-07 16:00:21 +0100
committerBarnabás Pőcze <barnabas.pocze@ideasonboard.com>2025-03-21 16:56:58 +0100
commit1df8091e631b72df8ecda105dae7934b54b1287c (patch)
treed9598feadb05dcf08078f7b9fedce621870500da /src
parent90208694c8c0652eb12407c016a649333a64f990 (diff)
libcamera: v4l2_videodevice: `lastUsedCounter_` need not be atomic
The `V4L2BufferCache` type is not thread-safe. Its `lastUsedCounter_` member is not used in contexts where its atomicity would matter. So it does not need to be have an atomic type. Signed-off-by: Barnabás Pőcze <barnabas.pocze@ideasonboard.com> Reviewed-by: Jacopo Mondi <jacopo.mondi@ideasonboard.com> Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
Diffstat (limited to 'src')
-rw-r--r--src/libcamera/v4l2_videodevice.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/libcamera/v4l2_videodevice.cpp b/src/libcamera/v4l2_videodevice.cpp
index e241eb47..f5b3fa09 100644
--- a/src/libcamera/v4l2_videodevice.cpp
+++ b/src/libcamera/v4l2_videodevice.cpp
@@ -190,7 +190,7 @@ V4L2BufferCache::V4L2BufferCache(const std::vector<std::unique_ptr<FrameBuffer>>
{
for (const std::unique_ptr<FrameBuffer> &buffer : buffers)
cache_.emplace_back(true,
- lastUsedCounter_.fetch_add(1, std::memory_order_acq_rel),
+ lastUsedCounter_++,
*buffer.get());
}
@@ -258,7 +258,7 @@ int V4L2BufferCache::get(const FrameBuffer &buffer)
return -ENOENT;
cache_[use] = Entry(false,
- lastUsedCounter_.fetch_add(1, std::memory_order_acq_rel),
+ lastUsedCounter_++,
buffer);
return use;