diff options
author | Barnabás Pőcze <pobrn@protonmail.com> | 2025-01-21 17:18:50 +0100 |
---|---|---|
committer | Barnabás Pőcze <pobrn@protonmail.com> | 2025-02-27 11:30:23 +0100 |
commit | 16bcc5a3e47e445879fa515b795da8165e76fd99 (patch) | |
tree | 375e37c804ccc7defb5f9feb78165abf092cde80 /src/v4l2 | |
parent | 5d0af9840bc268168712862acda2a4674eb3be5d (diff) |
libcamera: base: log: Make `LogCategory::severity_` atomic
The severity of a log category may be changed from a different thread,
so it is important to ensure that the reads and writes happen atomically.
Using `std::memory_order_relaxed` should not introduce any synchronization
overhead, it should only guarantee that the operation itself is atomic.
Secondly, inline `LogCategory::setSeverity()`, as it is merely an
assignment, so going through a DSO call is a big pessimization.
`LogCategory` is not part of the public API, so this change has
no external effects.
Thirdly, assert that the atomic variable is lock free so as to ensure
it won't silently fall back to libatomic (or similar) on any platform.
If this assertion fails, this needs to be revisited.
Signed-off-by: Barnabás Pőcze <pobrn@protonmail.com>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: Jacopo Mondi <jacopo.mondi@ideasonboard.com>
Diffstat (limited to 'src/v4l2')
0 files changed, 0 insertions, 0 deletions