<div dir="ltr"><div dir="ltr">Hi Jacopo, thank you for the patch.</div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Thu, May 13, 2021 at 6:22 PM Jacopo Mondi <<a href="mailto:jacopo@jmondi.org">jacopo@jmondi.org</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">With the introduction of an additional mutex class member, the name of<br>
the existing one is too generic.<br>
<br>
Rename CameraDevice::mutex_ in CameraDevice::requestsMutex_ and use the<br>
libcamera provided libcamera::Mutex type to align the style with the<br>
rest of the code base.<br>
<br>
Signed-off-by: Jacopo Mondi <<a href="mailto:jacopo@jmondi.org" target="_blank">jacopo@jmondi.org</a>><br>
Reviewed-by: Niklas Söderlund <<a href="mailto:niklas.soderlund@ragnatech.se" target="_blank">niklas.soderlund@ragnatech.se</a>><br></blockquote><div><br></div><div>Reviewed-by: Hirokazu Honda <<a href="mailto:hiroh@chromium.org">hiroh@chromium.org</a>></div><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
---<br>
src/android/camera_device.cpp | 4 ++--<br>
src/android/camera_device.h | 3 ++-<br>
2 files changed, 4 insertions(+), 3 deletions(-)<br>
<br>
diff --git a/src/android/camera_device.cpp b/src/android/camera_device.cpp<br>
index c6cd0b6e8be7..7f8c9bd7832d 100644<br>
--- a/src/android/camera_device.cpp<br>
+++ b/src/android/camera_device.cpp<br>
@@ -2024,7 +2024,7 @@ int CameraDevice::processCaptureRequest(camera3_capture_request_t *camera3Reques<br>
worker_.queueRequest(descriptor.request_.get());<br>
<br>
{<br>
- MutexLocker lock(mutex_);<br>
+ MutexLocker requestsLock(requestsMutex_);<br>
descriptors_[descriptor.request_->cookie()] = std::move(descriptor);<br>
}<br>
<br>
@@ -2035,7 +2035,7 @@ void CameraDevice::requestComplete(Request *request)<br>
{<br>
decltype(descriptors_)::node_type node;<br>
{<br>
- MutexLocker lock(mutex_);<br>
+ MutexLocker requestsLock(requestsMutex_);<br>
auto it = descriptors_.find(request->cookie());<br>
if (it == descriptors_.end()) {<br>
/*<br>
diff --git a/src/android/camera_device.h b/src/android/camera_device.h<br>
index f263fdae472a..ed992ae56d5d 100644<br>
--- a/src/android/camera_device.h<br>
+++ b/src/android/camera_device.h<br>
@@ -24,6 +24,7 @@<br>
#include "libcamera/internal/buffer.h"<br>
#include "libcamera/internal/log.h"<br>
#include "libcamera/internal/message.h"<br>
+#include "libcamera/internal/thread.h"<br>
<br>
#include "camera_metadata.h"<br>
#include "camera_stream.h"<br>
@@ -134,7 +135,7 @@ private:<br>
std::map<int, libcamera::PixelFormat> formatsMap_;<br>
std::vector<CameraStream> streams_;<br>
<br>
- std::mutex mutex_; /* Protect descriptors_ */<br>
+ libcamera::Mutex requestsMutex_; /* Protects descriptors_. */<br>
std::map<uint64_t, Camera3RequestDescriptor> descriptors_;<br>
<br>
std::string maker_;<br>
-- <br>
2.31.1<br>
<br>
_______________________________________________<br>
libcamera-devel mailing list<br>
<a href="mailto:libcamera-devel@lists.libcamera.org" target="_blank">libcamera-devel@lists.libcamera.org</a><br>
<a href="https://lists.libcamera.org/listinfo/libcamera-devel" rel="noreferrer" target="_blank">https://lists.libcamera.org/listinfo/libcamera-devel</a><br>
</blockquote></div></div>