Skip to content
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

[core] Proposed solution for m_ConnectionLock/m_LSLock inversion #2743

Closed

Conversation

ethouris
Copy link
Collaborator

@ethouris ethouris commented May 30, 2023

The solution is to prevent applying m_ConnectionLock when the queue is being set the listener.

The same socket will not be attempted to be set listen by another thread because the m_bListening flag prevents this, and it's atomically checked and set under the m_ConnectionLock.

An important logical change is that m_bListening is set true when the listener is ATTEMPTED to be changed, but if this failed, and would be reported by exception, the flag is set back to false. This flag only influences the read-ready flag (which is unimportant for a socket that is not connected) and to remove the listening state when closing. This latter procedure still checks if the listener attempted to be removed is the same as the one that was set and does nothing if not.

Earlier versions: #1824 and #1844

@ethouris ethouris added Type: Maintenance Work required to maintain or clean up the code [core] Area: Changes in SRT library core labels May 30, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[core] Area: Changes in SRT library core Type: Maintenance Work required to maintain or clean up the code
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant