Message ID | 20211029041424.1430886-7-hiroh@chromium.org |
---|---|
State | Superseded |
Headers | show |
Series |
|
Related | show |
Hi Hiro, Thank you for the patch. On 10/29/21 9:44 AM, Hirokazu Honda wrote: > This applies clang thread safety annotation to > Camera3RequestDescriptor. Mutex and MutexLocker there are > replaced with Mutex2 and MutexLocer2. > > Signed-off-by: Hirokazu Honda <hiroh@chromium.org> Looks fine to me, Reviewed-by: Umang Jain <umang.jain@ideasonboard.com> > --- > src/android/camera_request.h | 7 ++++--- > 1 file changed, 4 insertions(+), 3 deletions(-) > > diff --git a/src/android/camera_request.h b/src/android/camera_request.h > index cfafa445..0c8e7287 100644 > --- a/src/android/camera_request.h > +++ b/src/android/camera_request.h > @@ -9,10 +9,11 @@ > > #include <map> > #include <memory> > -#include <mutex> > #include <vector> > > #include <libcamera/base/class.h> > +#include <libcamera/base/mutex.h> > +#include <libcamera/base/thread_annotations.h> > > #include <libcamera/camera.h> > #include <libcamera/framebuffer.h> > @@ -46,8 +47,8 @@ public: > }; > > /* Keeps track of streams requiring post-processing. */ > - std::map<CameraStream *, StreamBuffer *> pendingStreamsToProcess_; > - std::mutex streamsProcessMutex_; > + std::map<CameraStream *, StreamBuffer *> pendingStreamsToProcess_ GUARDED_BY(streamsProcessMutex_); > + libcamera::Mutex2 streamsProcessMutex_; > > Camera3RequestDescriptor(libcamera::Camera *camera, > const camera3_capture_request_t *camera3Request);
diff --git a/src/android/camera_request.h b/src/android/camera_request.h index cfafa445..0c8e7287 100644 --- a/src/android/camera_request.h +++ b/src/android/camera_request.h @@ -9,10 +9,11 @@ #include <map> #include <memory> -#include <mutex> #include <vector> #include <libcamera/base/class.h> +#include <libcamera/base/mutex.h> +#include <libcamera/base/thread_annotations.h> #include <libcamera/camera.h> #include <libcamera/framebuffer.h> @@ -46,8 +47,8 @@ public: }; /* Keeps track of streams requiring post-processing. */ - std::map<CameraStream *, StreamBuffer *> pendingStreamsToProcess_; - std::mutex streamsProcessMutex_; + std::map<CameraStream *, StreamBuffer *> pendingStreamsToProcess_ GUARDED_BY(streamsProcessMutex_); + libcamera::Mutex2 streamsProcessMutex_; Camera3RequestDescriptor(libcamera::Camera *camera, const camera3_capture_request_t *camera3Request);
This applies clang thread safety annotation to Camera3RequestDescriptor. Mutex and MutexLocker there are replaced with Mutex2 and MutexLocer2. Signed-off-by: Hirokazu Honda <hiroh@chromium.org> --- src/android/camera_request.h | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-)