Skip to content

Commit

Permalink
Merge pull request #99 from nobleo/fix/98_concurrence_preempt_while_t…
Browse files Browse the repository at this point in the history
…erminating

Potential fix for preempting a concurrence container while it was already terminating
  • Loading branch information
130s authored Oct 16, 2024
2 parents 295921b + 3e7a82a commit bcdf03c
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 @@ -276,6 +276,15 @@ def execute(self, parent_ud = None):
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 bcdf03c

Please sign in to comment.