Skip to content

Commit 4a64b25

Browse files
authored
[Spawner] Release the lock while waiting for the interrupt (#2559) (#2567)
1 parent 6b5349b commit 4a64b25

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

controller_manager/controller_manager/spawner.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -347,6 +347,8 @@ def main(args=None):
347347
if not unload_controllers_upon_exit:
348348
return 0
349349

350+
# The lock has to be released to not block other spawner instances while waiting for the interrupt
351+
lock.release()
350352
logger.info("Waiting until interrupt to unload controllers")
351353
while True:
352354
time.sleep(1)
@@ -402,7 +404,8 @@ def main(args=None):
402404
finally:
403405
if node:
404406
node.destroy_node()
405-
lock.release()
407+
if lock.is_locked:
408+
lock.release()
406409
rclpy.shutdown()
407410

408411

0 commit comments

Comments
 (0)