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

crossbeam_epoch::Atomic::into_owned #369

Closed
vorner opened this issue May 5, 2019 · 1 comment · Fixed by #371
Closed

crossbeam_epoch::Atomic::into_owned #369

vorner opened this issue May 5, 2019 · 1 comment · Fixed by #371

Comments

@vorner
Copy link
Contributor

vorner commented May 5, 2019

Hello

I'm wondering why the Atomic doesn't have an unsafe fn into_owned(self) -> Owned<T> method. I'd find it handy in a data structure destructor, when I'm sure that no concurrent accesses are being made to the structure any more, as it's in the destructor which is &mut self.

Now, I can do a load on the atomic with epoch::unprotected and convert that shared. But is there a particular reason why the above method doesn't exist? If not, is it OK if I send a PR?

@ghost
Copy link

ghost commented May 6, 2019

There is no particular reason why it doesn't exist - a PR would be welcome!

bors bot added a commit that referenced this issue May 8, 2019
371: epoch: Add Atomic::into_owned r=stjepang a=vorner

To mimic Shared::into_owned.

Closes #369

Co-authored-by: Michal 'vorner' Vaner <vorner@vorner.cz>
@bors bors bot closed this as completed in #371 May 8, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

Successfully merging a pull request may close this issue.

1 participant