diff --git a/rclpy/rclpy/__init__.py b/rclpy/rclpy/__init__.py index c14184ec4..3c8a9b751 100644 --- a/rclpy/rclpy/__init__.py +++ b/rclpy/rclpy/__init__.py @@ -207,6 +207,9 @@ def spin_once( It is possible the work done is for a node other than the one provided if the global executor has a partially completed coroutine. + This method should not be called from multiple threads with the same node or executor + argument. + :param node: A node to add to the executor to check for work. :param executor: The executor to use, or the global executor if ``None``. :param timeout_sec: Seconds to wait. Block forever if ``None`` or negative. Don't wait if 0. diff --git a/rclpy/rclpy/executors.py b/rclpy/rclpy/executors.py index 52b814b6d..a6ed8e508 100644 --- a/rclpy/rclpy/executors.py +++ b/rclpy/rclpy/executors.py @@ -339,6 +339,8 @@ def spin_once(self, timeout_sec: Optional[float] = None) -> None: A custom executor should use :meth:`wait_for_ready_callbacks` to get work. + This method should not be called from multiple threads. + :param timeout_sec: Seconds to wait. Block forever if ``None`` or negative. Don't wait if 0. """