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

Conn: wrap fields protected by mu in struct. #379

Merged
merged 2 commits into from
Dec 13, 2022

Conversation

zenhack
Copy link
Contributor

@zenhack zenhack commented Dec 13, 2022

Per the comment, this makes it much easier to tell at a call site whether you need to be holding the lock. In the process of doing this, I also added comments on two methods where the need to hold the lock was not documented, and also pulled the closed channel out of this section -- it is not actually supposed to be protected by Conn.mu

Per the comment, this makes it much easier to tell at a call site
whether you need to be holding the lock. In the process of doing this,
I also added comments on two methods where the need to hold the lock was
not documented, and also pulled the `closed` channel out of this section
-- it is not actually supposed to be protected by Conn.mu
Copy link
Collaborator

@lthibault lthibault left a comment

Choose a reason for hiding this comment

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

Generally onboard with this strategy, but I find the API a bit awkward. See suggestion inline.

rpc/rpc.go Outdated Show resolved Hide resolved
@lthibault lthibault merged commit d105cc4 into capnproto:main Dec 13, 2022
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.

2 participants