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>
This commit is contained in:
committed by
Umang Jain
parent
056da47e2d
commit
b5d26eab4d
@@ -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;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user