Skip to content

Commit f9e049a

Browse files
committed
add info about sync
1 parent 238bb38 commit f9e049a

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/libcore/cell.rs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,9 @@
2222
//!
2323
//! Shareable mutable containers exist to permit mutability in presence of aliasing in a
2424
//! 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`.
2628
//!
2729
//! Values of the `Cell<T>` and `RefCell<T>` types may be mutated through shared references (i.e.
2830
//! the common `&T` type), whereas most Rust types can only be mutated through unique (`&mut T`)

0 commit comments

Comments
 (0)