[libcamera-devel] [PATCH v2 3/5] libcamera: camera_manager: Make CameraManager::Private::mutex_ mutable

paul.elder at ideasonboard.com paul.elder at ideasonboard.com
Tue Oct 20 05:57:39 CEST 2020


On Tue, Oct 20, 2020 at 04:40:03AM +0300, Laurent Pinchart wrote:
> The mutex_ stored in the CameraManager::Private class is used to protect
> members that may need to be accessed from const functions. Make it
> mutable to allow this.
> 
> Signed-off-by: Laurent Pinchart <laurent.pinchart at ideasonboard.com>
> Reviewed-by: Niklas Söderlund <niklas.soderlund at ragnatech.se>
> Reviewed-by: Jacopo Mondi <jacopo at jmondi.org>

Reviewed-by: Paul Elder <paul.elder at ideasonboard.com>

> ---
>  src/libcamera/camera_manager.cpp | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/src/libcamera/camera_manager.cpp b/src/libcamera/camera_manager.cpp
> index 81785f919d8b..3fef69633028 100644
> --- a/src/libcamera/camera_manager.cpp
> +++ b/src/libcamera/camera_manager.cpp
> @@ -50,7 +50,7 @@ public:
>  	 * - initialized_ and status_ during initialization
>  	 * - cameras_ and camerasByDevnum_ after initialization
>  	 */
> -	Mutex mutex_;
> +	mutable Mutex mutex_;
>  	std::vector<std::shared_ptr<Camera>> cameras_;
>  	std::map<dev_t, std::weak_ptr<Camera>> camerasByDevnum_;
>  
> -- 
> Regards,
> 
> Laurent Pinchart
> 
> _______________________________________________
> libcamera-devel mailing list
> libcamera-devel at lists.libcamera.org
> https://lists.libcamera.org/listinfo/libcamera-devel


More information about the libcamera-devel mailing list