Skip to content

Commit

Permalink
Apply race condition fix to mux (#78) (#88)
Browse files Browse the repository at this point in the history
Apply fix described in #56 to mux_node

Signed-off-by: Andrew Best <andrew.best@tri.global>
(cherry picked from commit 7dc8c43)

Co-authored-by: andrewbest-tri <43861892+andrewbest-tri@users.noreply.github.com>
  • Loading branch information
mergify[bot] and andrewbest-tri authored Nov 17, 2023
1 parent 8560b63 commit 5e68716
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions topic_tools/src/mux_node.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,10 @@ void MuxNode::make_subscribe_unsubscribe_decisions()

void MuxNode::process_message(std::shared_ptr<rclcpp::SerializedMessage> msg)
{
std::scoped_lock lock(pub_mutex_);
if (!pub_) {
return;
}
pub_->publish(*msg);
}

Expand Down

0 comments on commit 5e68716

Please sign in to comment.