diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/libcamera/pipeline_handler.cpp | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/src/libcamera/pipeline_handler.cpp b/src/libcamera/pipeline_handler.cpp index 3d61311c..2d2bb940 100644 --- a/src/libcamera/pipeline_handler.cpp +++ b/src/libcamera/pipeline_handler.cpp @@ -10,6 +10,7 @@ #include <sys/sysmacros.h> #include <libcamera/base/log.h> +#include <libcamera/base/thread.h> #include <libcamera/base/utils.h> #include <libcamera/camera.h> @@ -150,6 +151,8 @@ MediaDevice *PipelineHandler::acquireMediaDevice(DeviceEnumerator *enumerator, */ bool PipelineHandler::lock() { + MutexLocker locker(lock_); + /* Do not allow nested locking in the same libcamera instance. */ if (lockOwner_) return false; @@ -178,6 +181,13 @@ bool PipelineHandler::lock() */ void PipelineHandler::unlock() { + MutexLocker locker(lock_); + + unlockLocked(); +} + +void PipelineHandler::unlockLocked() +{ if (lockOwner_) return; |