ipa: rpi: Add try_lock() to RPiController::Metadata

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@raspberrypi.com>
Reviewed-by: David Plowman <david.plowman@raspberrypi.com>
Reviewed-by: Jacopo Mondi <jacopo.mondi@ideasonboard.com>
Signed-off-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
This commit is contained in:
Naushir Patuck
2023-10-13 08:48:27 +01:00
committed by Kieran Bingham
parent 6f44b9f969
commit 0548079581
+1
View File
@@ -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: