Skip to content

Commit

Permalink
fix the problem of deadlock when recording the message
Browse files Browse the repository at this point in the history
  • Loading branch information
fengjingchao-cn authored and ycool committed Dec 30, 2017
1 parent 33cb2e6 commit 7d98ddf
Showing 1 changed file with 21 additions and 0 deletions.
21 changes: 21 additions & 0 deletions ros/ros_comm/roscpp/src/libros/subscription.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -680,6 +680,27 @@ uint32_t Subscription::handleMessage(const SerializedMessage& m, bool ser, bool
}
}

if (name_ == "/rosout" || name_ == "/rosout_agg" || name_ == "/tf")
{
if (link)
{
// measure statistics
statistics_.callback(connection_header, name_, link->getCallerID(),
m, link->getStats().bytes_received_, receipt_time, drops > 0);
// If this link is latched, store off the message so we can immediately
// pass it to new subscribers later
if (link->isLatched())
{
LatchInfo li;
li.connection_header = connection_header;
li.link = link;
li.message = m;
li.receipt_time = receipt_time;
latched_messages_[link] = li;
}
}
}
else
{
boost::mutex::scoped_lock lock(publisher_links_mutex_);
for (V_PublisherLink::iterator it = publisher_links_.begin(); it != publisher_links_.end(); ++it)
Expand Down

0 comments on commit 7d98ddf

Please sign in to comment.