@@ -301,24 +301,19 @@ void DdsPipe::discovered_endpoint_nts_(
301301 {
302302 // there is a filter.
303303 // update the track of the topic to
304- // add the partition in the reader if it is in the filter
304+ // add the partition in the reader if it is in the filter
305305
306- // update partitions under bridges_mutex_
306+ const auto bridge_it = bridges_.find (utils::Heritable<DdsTopic>::make_heritable (endpoint.topic ));
307+ // add the specific partition of the endpoint in the bridges topic.
308+ if (bridge_it != bridges_.end ())
307309 {
308- std::lock_guard<std::mutex> lock (bridges_mutex_);
310+ std::ostringstream guid_ss;
311+ guid_ss << endpoint.guid ;
309312
310- const auto bridge_it = bridges_.find (utils::Heritable<DdsTopic>::make_heritable (endpoint.topic ));
311- // add the specific partition of the endpoint in the bridges topic.
312- if (bridge_it != bridges_.end ())
313+ const auto part_it = endpoint.specific_partitions .find (guid_ss.str ());
314+ if (part_it != endpoint.specific_partitions .end ())
313315 {
314- std::ostringstream guid_ss;
315- guid_ss << endpoint.guid ;
316-
317- const auto part_it = endpoint.specific_partitions .find (guid_ss.str ());
318- if (part_it != endpoint.specific_partitions .end ())
319- {
320- bridge_it->second ->add_partition_to_topic (guid_ss.str (), part_it->second );
321- }
316+ bridge_it->second ->add_partition_to_topic (guid_ss.str (), part_it->second );
322317 }
323318 }
324319
@@ -653,9 +648,6 @@ void DdsPipe::update_content_filter(
653648void DdsPipe::update_filter (
654649 const std::set<std::string> filter_partition_set)
655650{
656- // Avoid possible datarace with partitions filter
657- std::lock_guard<std::mutex> lock (bridges_mutex_);
658-
659651 filter_partition_ = std::move (filter_partition_set);
660652}
661653
0 commit comments