Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 5 additions & 6 deletions rclpy/rclpy/executors.py
Original file line number Diff line number Diff line change
Expand Up @@ -435,8 +435,7 @@ def spin_until_future_complete(
now = time.monotonic()

if now >= end:
self._exit_spin()
return
break

timeout_left.timeout = end - now
finally:
Expand Down Expand Up @@ -1109,10 +1108,10 @@ def _spin_once_impl(
self._executor.submit(handler)
self._futures.append(handler)
Comment thread
fujitatomoya marked this conversation as resolved.
with self._futures_lock:
for future in self._futures:
if future.done():
self._futures.remove(future)
future.result() # raise any exceptions
done_futures = [f for f in self._futures if f.done() or f.cancelled()]
for future in done_futures:
self._futures.remove(future)
future.result() # raise any exceptions

# Yield GIL so executor threads have a chance to run.
os.sched_yield() if hasattr(os, 'sched_yield') else time.sleep(0)
Expand Down