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

impl Sync for sharedring::{Receiver, Sender} ? #2

Closed
dovahcrow opened this issue Oct 10, 2022 · 2 comments
Closed

impl Sync for sharedring::{Receiver, Sender} ? #2

dovahcrow opened this issue Oct 10, 2022 · 2 comments

Comments

@dovahcrow
Copy link
Contributor

It seems to me that it is safe to implement Sync for Receiver and Sender because the recv and send methods require &mut which implies at most one reader and writer as https://docs.rs/shmem-ipc/latest/shmem_ipc/sharedring/struct.Sender.html#safety required.

@diwic diwic closed this as completed in 3db5cfe Oct 11, 2022
@diwic
Copy link
Owner

diwic commented Oct 11, 2022

Hi and thanks for the suggestion. I quickly wrote a patch, can you see if this fixes things for you and if not, please reopen. Thanks!

@dovahcrow
Copy link
Contributor Author

Thank you! I'll try it out in https://github.com/dovahcrow/shaman, which is based on this excellent work.

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

2 participants