summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorHirokazu Honda <hiroh@chromium.org>2022-11-03 18:50:37 +0530
committerUmang Jain <umang.jain@ideasonboard.com>2022-11-11 16:25:46 +0530
commitb5d26eab4dfba37f188ce66ba356e2cc30a4000a (patch)
tree5e6fc1b14776d3f0e96df56337096e0e8fbf5953 /include
parent056da47e2d8cbc6baa12c5d09cc0a9102517fc80 (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 'include')
-rw-r--r--include/libcamera/base/semaphore.h10
1 files changed, 5 insertions, 5 deletions
diff --git a/include/libcamera/base/semaphore.h b/include/libcamera/base/semaphore.h
index c11e8dd1..f1052317 100644
--- a/include/libcamera/base/semaphore.h
+++ b/include/libcamera/base/semaphore.h
@@ -18,15 +18,15 @@ class Semaphore
public:
Semaphore(unsigned int n = 0);
- unsigned int available();
- void acquire(unsigned int n = 1);
- bool tryAcquire(unsigned int n = 1);
- void release(unsigned int n = 1);
+ unsigned int available() LIBCAMERA_TSA_EXCLUDES(mutex_);
+ void acquire(unsigned int n = 1) LIBCAMERA_TSA_EXCLUDES(mutex_);
+ bool tryAcquire(unsigned int n = 1) LIBCAMERA_TSA_EXCLUDES(mutex_);
+ void release(unsigned int n = 1) LIBCAMERA_TSA_EXCLUDES(mutex_);
private:
Mutex mutex_;
ConditionVariable cv_;
- unsigned int available_;
+ unsigned int available_ LIBCAMERA_TSA_GUARDED_BY(mutex_);
};
} /* namespace libcamera */