Message ID | 20231006132000.23504-7-naush@raspberrypi.com |
---|---|
State | Superseded |
Headers | show |
Series |
|
Related | show |
Hi Naush On Fri, Oct 06, 2023 at 02:19:46PM +0100, Naushir Patuck via libcamera-devel wrote: > 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> Thanks j > --- > 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 >
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: