diff options
author | Hirokazu Honda <hiroh@chromium.org> | 2022-11-03 18:50:37 +0530 |
---|---|---|
committer | Umang Jain <umang.jain@ideasonboard.com> | 2022-11-11 16:25:46 +0530 |
commit | b5d26eab4dfba37f188ce66ba356e2cc30a4000a (patch) | |
tree | 5e6fc1b14776d3f0e96df56337096e0e8fbf5953 /src | |
parent | 056da47e2d8cbc6baa12c5d09cc0a9102517fc80 (diff) |
libcamera: base: semaphore: Apply clang thread safety annotation
This annotates member functions and variables of Semaphore 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')
-rw-r--r-- | src/libcamera/base/semaphore.cpp | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/src/libcamera/base/semaphore.cpp b/src/libcamera/base/semaphore.cpp index 4fe30293..6217e386 100644 --- a/src/libcamera/base/semaphore.cpp +++ b/src/libcamera/base/semaphore.cpp @@ -56,7 +56,9 @@ unsigned int Semaphore::available() void Semaphore::acquire(unsigned int n) { MutexLocker locker(mutex_); - cv_.wait(locker, [&] { return available_ >= n; }); + cv_.wait(locker, [&]() LIBCAMERA_TSA_REQUIRES(mutex_) { + return available_ >= n; + }); available_ -= n; } |