summaryrefslogtreecommitdiff
path: root/src/ipa
diff options
context:
space:
mode:
authorNaushir Patuck <naush@raspberrypi.com>2023-10-13 08:48:27 +0100
committerKieran Bingham <kieran.bingham@ideasonboard.com>2023-10-18 11:01:22 +0100
commit05480795813118c5fd1e4550c2b91aa4436365ff (patch)
tree5103f8447c457e1f894eae334e1a7ee5ef50fcc2 /src/ipa
parent6f44b9f96950d0880a10b7e62502788bbc878f9f (diff)
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>
Diffstat (limited to 'src/ipa')
-rw-r--r--src/ipa/rpi/controller/metadata.h1
1 files changed, 1 insertions, 0 deletions
diff --git a/src/ipa/rpi/controller/metadata.h b/src/ipa/rpi/controller/metadata.h
index bf8a2393..a232dcb1 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: