-
Notifications
You must be signed in to change notification settings - Fork 770
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[15341] Protect access to reader listeners #2898
Conversation
Signed-off-by: Miguel Company <[email protected]>
Signed-off-by: Miguel Company <[email protected]>
…ific mutex. Signed-off-by: Miguel Company <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This should be protected as well.
@@ -1637,6 +1639,8 @@ fastrtps::TopicAttributes DataReaderImpl::topic_attributes() const | |||
DataReaderListener* DataReaderImpl::get_listener_for( | |||
const StatusMask& status) | |||
{ | |||
std::lock_guard<std::mutex> _(listener_mutex_); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe it would be best to keep the final return clause outside the scope of this mutex.
Signed-off-by: Miguel Company <[email protected]>
I have mixed feelings about this. My fear is that taking the reader mutex may add ABBA deadlocks... |
I'm of the same mind regarding GetListener. Let's just keep it as is for now. |
@richiprosima Please test this |
Description
This should fix dataraces involving access to the listener on
RTPSReader
andDataReaderImpl
.Contributor Checklist
versions.md
file (if applicable).Reviewer Checklist