I've published a smart pointer to crate.io, based on our previous discussion (https://www.reddit.com/r/rust/comments/1pipj05/atomic_memory_ordering_confusion_can_atomic/). I think it might be okay now, but who knows.

Since the code is quite short, I'll post it here for convenience.

Edit: for bugs found by Consistent_Milk4660, I modified the code as following:

use std::{ cell::UnsafeCell, ops::Deref, sync::{ Arc, atomic::{self, AtomicI32, Ordering}, }, }; /// A smart pointer similar to `Arc<T>`, but allows `T` to be /// safely dropped early, providi...

Similar Posts

Loading similar posts...

Keyboard Shortcuts

Navigation
Next / previous item
j/k
Open post
oorEnter
Preview post
v
Post Actions
Love post
a
Like post
l
Dislike post
d
Undo reaction
u
Recommendations
Add interest / feed
Enter
Not interested
x
Go to
Home
gh
Interests
gi
Feeds
gf
Likes
gl
History
gy
Changelog
gc
Settings
gs
Browse
gb
Search
/
General
Show this help
?
Submit feedback
!
Close modal / unfocus
Esc

Press ? anytime to show this help