-
Notifications
You must be signed in to change notification settings - Fork 12.9k
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
Restore DISCONNECTED
state in oneshot::Packet::send
#36893
Conversation
r? @brson (rust_highfive has picked a reviewer for you, use r? to override) |
Thanks for the PR! I think this is almost everything we need here, but we may also want to alter the
Believe it or not, all of this code was written before |
I've opened up #36934 about the mutability concerns. I hasn't seemed to be a problem yet, but I'm sure as we start optimizing more aggressively it'll cause problems! |
@alexcrichton Makes sense. I'll try to make the modification later today. |
@alexcrichton Done. |
@bors: r+ |
📌 Commit fb90e4c has been approved by |
Restore `DISCONNECTED` state in `oneshot::Packet::send` Closes #32114 I'm not sure if this is the best approach, but the current action of swapping `DISCONNECTED` with `DATA` seems wrong. Additionally, it is strange that the `send` method (and others in the `oneshot` module) takes `&mut self` despite performing atomic operations, as this requires extra discipline to avoid data races and lets us use methods like `AtomicUsize::get_mut` instead of methods that require a memory ordering.
Closes #32114
I'm not sure if this is the best approach, but the current action of swapping
DISCONNECTED
withDATA
seems wrong. Additionally, it is strange that thesend
method (and others in theoneshot
module) takes&mut self
despite performing atomic operations, as this requires extra discipline to avoid data races and lets us use methods likeAtomicUsize::get_mut
instead of methods that require a memory ordering.