diff options
author | Laurent Pinchart <laurent.pinchart@ideasonboard.com> | 2021-08-29 21:10:57 +0300 |
---|---|---|
committer | Laurent Pinchart <laurent.pinchart@ideasonboard.com> | 2021-11-19 22:38:44 +0200 |
commit | f6a5d675b1cfd1ee9cb9358526e1f84b821b9e07 (patch) | |
tree | 73b0c87750d811008f1a919c74fd342685438dc5 /include | |
parent | d9ae18088a62afc9cebcaa35809fa2457c37bac8 (diff) |
libcamera: pipeline_handler: Make lock() and unlock() thread-safe
The PipelineHandler lock() and unlock() functions are documented as
thread-safe, but they're not. Fix them using a mutex.
Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Diffstat (limited to 'include')
-rw-r--r-- | include/libcamera/internal/pipeline_handler.h | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/include/libcamera/internal/pipeline_handler.h b/include/libcamera/internal/pipeline_handler.h index fc6d476b..b473eb70 100644 --- a/include/libcamera/internal/pipeline_handler.h +++ b/include/libcamera/internal/pipeline_handler.h @@ -14,6 +14,7 @@ #include <vector> #include <libcamera/base/object.h> +#include <libcamera/base/thread.h> #include <libcamera/controls.h> #include <libcamera/stream.h> @@ -73,6 +74,8 @@ protected: CameraManager *manager_; private: + void unlockLocked(); + void mediaDeviceDisconnected(MediaDevice *media); virtual void disconnect(); @@ -81,6 +84,7 @@ private: const char *name_; + Mutex lock_; bool lockOwner_; friend class PipelineHandlerFactory; |