Skip to content

Commit a2f9adb

Browse files
committed
Refs #21355. Protect InnerDataReaderListener::on_reader_matched.
Signed-off-by: Miguel Company <miguelcompany@eprosima.com>
1 parent eb8bd48 commit a2f9adb

2 files changed

Lines changed: 5 additions & 0 deletions

File tree

src/cpp/fastdds/subscriber/DataReaderImpl.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -941,6 +941,8 @@ void DataReaderImpl::InnerDataReaderListener::on_reader_matched(
941941
RTPSReader* /*reader*/,
942942
const MatchingInfo& info)
943943
{
944+
std::lock_guard<std::mutex> scoped_lock(matching_info_mutex_);
945+
944946
data_reader_->update_subscription_matched_status(info);
945947

946948
StatusMask notify_status = StatusMask::subscription_matched();

src/cpp/fastdds/subscriber/DataReaderImpl.hpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -511,7 +511,10 @@ class DataReaderImpl
511511
const uint32_t& status_id);
512512
#endif //FASTDDS_STATISTICS
513513

514+
private:
515+
514516
DataReaderImpl* data_reader_;
517+
std::mutex matching_info_mutex_;
515518

516519
}
517520
reader_listener_;

0 commit comments

Comments
 (0)