Skip to content

Commit

Permalink
Potential fix for preempting a concurrence container while it was alr…
Browse files Browse the repository at this point in the history
…eady terminating
  • Loading branch information
Ferry Schoenmakers committed Feb 21, 2023
1 parent d4226ba commit 3e7a82a
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions smach/src/smach/concurrence.py
Original file line number Diff line number Diff line change
Expand Up @@ -272,6 +272,15 @@ def execute(self, parent_ud = smach.UserData()):
if children_preempts_serviced:
smach.loginfo("Concurrence serviced preempt.")
self.service_preempt()
# Cleanup and return preempted
outcome = 'preempted'
self._threads = {}
self._child_outcomes = {}
# Call termination callbacks
self.call_termination_cbs(list(self._states.keys()), outcome)
# Copy output keys
self._copy_output_keys(self.userdata, parent_ud)
return outcome

# Spew some debyg info
smach.loginfo("Concurrent Outcomes: "+str(self._child_outcomes))
Expand Down

0 comments on commit 3e7a82a

Please sign in to comment.