Skip to content

Conversation

@dennwc
Copy link
Contributor

@dennwc dennwc commented Nov 13, 2025

No description provided.

@dennwc dennwc requested a review from a team as a code owner November 13, 2025 17:07
@dennwc dennwc self-assigned this Nov 13, 2025
Comment on lines +1599 to +1600
c.mu.RLock()
defer c.mu.RUnlock()
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is just here to explicitly create a memory barrier, right?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Right, the slices is ~24 bytes wide, so it won't be an atomic read.

But in general, in Go it's better to always lock things. Compiler could be aggressive when optimizing and it's safer to assume that the state will be used by other goroutines sooner or later. It may lead to very subtle bugs if we rely on implicit atomic reads.

@dennwc dennwc merged commit b22ab7c into main Nov 14, 2025
6 checks passed
@dennwc dennwc deleted the reinvite-our-sdp branch November 14, 2025 09:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants