From 1bf284562e956aa0ab96d1e014c828d4af5201bc Mon Sep 17 00:00:00 2001 From: Remi Cadene Date: Wed, 25 Sep 2024 11:36:08 +0200 Subject: [PATCH] pre-commit run --all-files --- lerobot/common/robot_devices/cameras/opencv.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/lerobot/common/robot_devices/cameras/opencv.py b/lerobot/common/robot_devices/cameras/opencv.py index 661fae6c..a2a4407e 100644 --- a/lerobot/common/robot_devices/cameras/opencv.py +++ b/lerobot/common/robot_devices/cameras/opencv.py @@ -219,10 +219,10 @@ class OpenCVCamera: self.camera = None self.is_connected = False self.thread = None - # Using Lock to avoid race condition and segfault when multiple threads - # access the same camera. This is not one of our use case, but we add this - # for safety if users want to use this class with threads. As a result, threads - # will go sequentially through the code logic protected by a lock, instead of + # Using Lock to avoid race condition and segfault when threads access the + # same camera. Though not currently a use case for LeRobot, lock ensures + # safety if users want to use this class with threads. As a result, threads + # will go sequentially through the code logic protected by a lock, instead of # in parallel. Also, we use Recursive Lock to avoid deadlock by allowing each # thread to acquire the lock multiple times. # TODO(rcadene, aliberts): Add RLock on every robot devices where it makes sense?