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

store(false) in the take method probably can have relaxed ordering #5

Open
jganetsk opened this issue Dec 29, 2020 · 0 comments
Open

Comments

@jganetsk
Copy link

jganetsk commented Dec 29, 2020

self.has_message.store(false, Ordering::Release);

There's no reason for the Release in the store above, and this can be changed to Relaxed, as there are no writes to the shared data occurring prior to the store operation. We know this because of core::ptr::read:

Reads the value from src without moving it. This leaves the memory in src unchanged.

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

No branches or pull requests

1 participant