mirror of
https://git.libcamera.org/libcamera/libcamera.git
synced 2025-07-25 09:35:06 +03:00
ipa: add missing thread-safety annotations
The raspberrypi IPA is missing thread-safety annotations, which breaks the build. Add required thread-safety annotations. ../src/ipa/raspberrypi/controller/metadata.h:108:31: error: mutex 'mutex_' is still held at the end of function [-Werror,-Wthread-safety-analysis] void lock() { mutex_.lock(); } ^ ../src/ipa/raspberrypi/controller/metadata.h:108:23: note: mutex acquired here void lock() { mutex_.lock(); } ^ ../src/ipa/raspberrypi/controller/metadata.h:109:25: error: releasing mutex 'mutex_' that was not held [-Werror,-Wthread-safety-analysis] void unlock() { mutex_.unlock(); } ^ Signed-off-by: Nicholas Roth <nicholas@rothemail.net> Reviewed-by: Jacopo Mondi <jacopo@jmondi.org> Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com> Reviewed-by: Naushir Patuck <naush@raspberrypi.com> Signed-off-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
This commit is contained in:
parent
a8113fb3a8
commit
88d059105b
1 changed files with 5 additions and 3 deletions
|
@ -13,9 +13,11 @@
|
|||
#include <mutex>
|
||||
#include <string>
|
||||
|
||||
#include <libcamera/base/thread_annotations.h>
|
||||
|
||||
namespace RPiController {
|
||||
|
||||
class Metadata
|
||||
class LIBCAMERA_TSA_CAPABILITY("mutex") Metadata
|
||||
{
|
||||
public:
|
||||
Metadata() = default;
|
||||
|
@ -103,8 +105,8 @@ public:
|
|||
* locks with the standard lock classes.
|
||||
* e.g. std::lock_guard<RPiController::Metadata> lock(metadata)
|
||||
*/
|
||||
void lock() { mutex_.lock(); }
|
||||
void unlock() { mutex_.unlock(); }
|
||||
void lock() LIBCAMERA_TSA_ACQUIRE() { mutex_.lock(); }
|
||||
void unlock() LIBCAMERA_TSA_RELEASE() { mutex_.unlock(); }
|
||||
|
||||
private:
|
||||
mutable std::mutex mutex_;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue