[−][src]Module reffers::arc
This is somewhat like an Arc<RwLock<T>>
, but with only one usize of overhead,
and the lock is a spinlock (there is no wait-and-sleep functionality).
Conceptually similar to rc, but this is a thread-safe version.
Example
use std::thread; use reffers::arcu::Strong; let s = Strong::<_>::new(987i32); let s2 = s.clone(); thread::spawn(move || { *s2.get_refmut() = 654i32; }).join().unwrap(); assert_eq!(*s.get_ref(), 654i32);
Structs
Ref | An Rc reference which has immutable access to the inner value. |
RefMut | An Arc which has mutable access to the inner value. Only one RefMut can exist, and cannot coexist with any Ref. |
Strong | A strong reference without access to the inner value. |
Weak | A weak reference without access to the inner value. |
Traits
Repr | This is an implementation detail. Please don't mess with it. |