Skip to content

Commit

Permalink
move function calls to complete terminal process in one mutex context
Browse files Browse the repository at this point in the history
  • Loading branch information
dsato80 committed Sep 13, 2020
1 parent 27e59d9 commit 11ae5aa
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
4 changes: 0 additions & 4 deletions rclcpp_action/include/rclcpp_action/server.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -385,10 +385,6 @@ class Server : public ServerBase, public std::enable_shared_from_this<Server<Act
}
// Send result message to anyone that asked
shared_this->publish_result(uuid, result_message);
// Publish a status message any time a goal handle changes state
shared_this->publish_status();
// notify base so it can recalculate the expired goal timer
shared_this->notify_goal_terminal_state();
// Delete data now (ServerBase and rcl_action_server_t keep data until goal handle expires)
std::lock_guard<std::mutex> lock(shared_this->goal_handles_mutex_);
shared_this->goal_handles_.erase(uuid);
Expand Down
5 changes: 5 additions & 0 deletions rclcpp_action/src/server.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -537,6 +537,11 @@ ServerBase::publish_result(const GoalUUID & uuid, std::shared_ptr<void> result_m
}
}
}

// Publish a status message any time a goal handle changes state
publish_status();
// notify base so it can recalculate the expired goal timer
notify_goal_terminal_state();
}

void
Expand Down

0 comments on commit 11ae5aa

Please sign in to comment.