File tree Expand file tree Collapse file tree 1 file changed +3
-1
lines changed Expand file tree Collapse file tree 1 file changed +3
-1
lines changed Original file line number Diff line number Diff line change 22
22
//!
23
23
//! Shareable mutable containers exist to permit mutability in presence of aliasing in a
24
24
//! controlled manner. Both `Cell<T>` and `RefCell<T>` allows to do this in a single threaded
25
- //! way. For multiple threads is possible to use `Mutex`, `RwLock` or `AtomicXXX`.
25
+ //! way, you can mutate them using an inmutable reference. However, neither `Cell<T>` nor
26
+ //! `RefCell<T>` are thread safe (they do not implement `Sync`), if you need to do Aliasing and
27
+ //! Mutation between multiple threads is possible to use `Mutex`, `RwLock` or `AtomicXXX`.
26
28
//!
27
29
//! Values of the `Cell<T>` and `RefCell<T>` types may be mutated through shared references (i.e.
28
30
//! the common `&T` type), whereas most Rust types can only be mutated through unique (`&mut T`)
You can’t perform that action at this time.
0 commit comments