Skip to content

Commit

Permalink
Stop locking twice in on_data_available
Browse files Browse the repository at this point in the history
  • Loading branch information
Thomas Moulard committed Dec 2, 2018
1 parent 4b3a749 commit f593443
Showing 1 changed file with 0 additions and 2 deletions.
2 changes: 0 additions & 2 deletions rmw_opensplice_cpp/src/types.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -227,7 +227,6 @@ CustomPublisherListener::on_data_available(DDS::DataReader * reader)
GuidPrefix_t guid;
DDS_BuiltinTopicKey_to_GUID(&guid, data_seq[i].key);
if (info_seq[i].instance_state == DDS::ALIVE_INSTANCE_STATE) {
std::lock_guard<std::mutex> lock(mutex_);
topic_name = data_seq[i].topic_name.in();
topic_cache.addTopic(guid, topic_name, data_seq[i].type_name.in());
print_discovery_logging("+", topic_name, data_seq[i].type_name.in(), PublisherEP);
Expand Down Expand Up @@ -281,7 +280,6 @@ CustomSubscriberListener::on_data_available(DDS::DataReader * reader)
if (info_seq[i].valid_data) {
GuidPrefix_t guid;
DDS_BuiltinTopicKey_to_GUID(&guid, data_seq[i].key);
std::lock_guard<std::mutex> lock(mutex_);
if (info_seq[i].instance_state == DDS::ALIVE_INSTANCE_STATE) {
topic_name = data_seq[i].topic_name.in();
topic_cache.addTopic(guid, topic_name, data_seq[i].type_name.in());
Expand Down

0 comments on commit f593443

Please sign in to comment.