[libcamera-devel] [PATCH v2 06/20] ipa: rpi: Add try_lock() to RPiController::Metadata
Naushir Patuck
naush at raspberrypi.com
Fri Oct 13 09:48:27 CEST 2023
Add the missing try_lock() member function to RPiController::Metadata.
This will allow RPiController::Metadata to be used as a template
parameter in std::scoped_lock.
Signed-off-by: Naushir Patuck <naush at raspberrypi.com>
Reviewed-by: David Plowman <david.plowman at raspberrypi.com>
Reviewed-by: Jacopo Mondi <jacopo.mondi at ideasonboard.com>
---
src/ipa/rpi/controller/metadata.h | 1 +
1 file changed, 1 insertion(+)
diff --git a/src/ipa/rpi/controller/metadata.h b/src/ipa/rpi/controller/metadata.h
index bf8a2393457a..a232dcb12456 100644
--- a/src/ipa/rpi/controller/metadata.h
+++ b/src/ipa/rpi/controller/metadata.h
@@ -116,6 +116,7 @@ public:
* e.g. std::lock_guard<RPiController::Metadata> lock(metadata)
*/
void lock() LIBCAMERA_TSA_ACQUIRE() { mutex_.lock(); }
+ auto try_lock() LIBCAMERA_TSA_ACQUIRE() { return mutex_.try_lock(); }
void unlock() LIBCAMERA_TSA_RELEASE() { mutex_.unlock(); }
private:
--
2.34.1
More information about the libcamera-devel
mailing list