-
Notifications
You must be signed in to change notification settings - Fork 712
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
bindings: mark Connection as Sync #4467
Conversation
/// Note: Although non-mutating methods like getters should be thread-safe by definition, | ||
/// technically the only thread safety guarantee provided by the underlying C library | ||
/// is that s2n_send and s2n_recv can be called concurrently. | ||
/// |
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.
I feel like this PR is a good time to take a whack at #4413
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.
Added, but you may regret that ask because the PR is much larger now :)
Please make sure all my reasoning makes sense. I'm trying to walk a fine line between explaining what Send and Sync mean (NOT what our documentation should do-- there's a lot of Rust documentation specifically on that topic) and not being helpful at all.
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.
Actually, too much larger. I don't want discussion of the documentation changes to block the Sync fix. I've moved the documentation changes to another PR: #4471
This reverts commit 36734d0.
Resolved issues:
resolves #4461
Description of changes:
Add Sync to the Connection struct. My code comment should explain why that is correct.
Call-outs:
We have to add Sync to ConnectionFuture and ConfigResolver, which is a breaking change. I couldn't find any uses of ConnectionFuture in public github repos or other public sources, so hopefully that breaking change isn't too painful. Only s2n-quic seems to be using ConfigResolver, and only for examples.
Testing:
New test to match Send test for context
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.