Skip to content

Commit

Permalink
Fix hang with timers in MultiThreadedExecutor (#835) (#836)
Browse files Browse the repository at this point in the history
Signed-off-by: Todd Malsbary <todd.malsbary@intel.com>
  • Loading branch information
malsbat authored and ivanpauno committed Sep 24, 2019
1 parent 3cdb3cb commit 2b7d012
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions rclcpp/src/rclcpp/executors/multi_threaded_executor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,11 @@ MultiThreadedExecutor::run(size_t)
if (any_exec.timer) {
// Guard against multiple threads getting the same timer.
if (scheduled_timers_.count(any_exec.timer) != 0) {
// Make sure that any_exec's callback group is reset before
// the lock is released.
if (any_exec.callback_group) {
any_exec.callback_group->can_be_taken_from().store(true);
}
continue;
}
scheduled_timers_.insert(any_exec.timer);
Expand Down

0 comments on commit 2b7d012

Please sign in to comment.