@@ -106,14 +106,14 @@ void PyCameraManager::readFd()
void PyCameraManager::pushRequest(Request *req)
{
- std::lock_guard guard(completedRequestsMutex_);
+ MutexLocker guard(completedRequestsMutex_);
completedRequests_.push_back(req);
}
std::vector<Request *> PyCameraManager::getCompletedRequests()
{
std::vector<Request *> v;
- std::lock_guard guard(completedRequestsMutex_);
+ MutexLocker guard(completedRequestsMutex_);
swap(v, completedRequests_);
return v;
}
@@ -5,7 +5,7 @@
#pragma once
-#include <mutex>
+#include <libcamera/base/mutex.h>
#include <libcamera/libcamera.h>
@@ -34,8 +34,9 @@ private:
std::unique_ptr<CameraManager> cameraManager_;
UniqueFD eventFd_;
- std::mutex completedRequestsMutex_;
- std::vector<Request *> completedRequests_;
+ libcamera::Mutex completedRequestsMutex_;
+ std::vector<Request *> completedRequests_
+ LIBCAMERA_TSA_GUARDED_BY(completedRequestsMutex_);
void writeFd();
void readFd();