diff options
author | Christian Poveda <christianpoveda@protonmail.com> | 2018-02-23 12:57:18 -0500 |
---|---|---|
committer | Christian Poveda <christianpoveda@protonmail.com> | 2018-02-23 12:57:18 -0500 |
commit | f9e049afc544e70dc595df67d878b52c098aaa9a (patch) | |
tree | b478db5d0bd1532b2d212cc504ea65a76243629e | |
parent | 238bb38a948ddf3d782f8138b39868cb08356c91 (diff) | |
download | rust-f9e049afc544e70dc595df67d878b52c098aaa9a.tar.gz |
add info about sync
-rw-r--r-- | src/libcore/cell.rs | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/src/libcore/cell.rs b/src/libcore/cell.rs index 75ed562ae54..1067b6ff0c1 100644 --- a/src/libcore/cell.rs +++ b/src/libcore/cell.rs @@ -22,7 +22,9 @@ //! //! Shareable mutable containers exist to permit mutability in presence of aliasing in a //! controlled manner. Both `Cell<T>` and `RefCell<T>` allows to do this in a single threaded -//! way. For multiple threads is possible to use `Mutex`, `RwLock` or `AtomicXXX`. +//! way, you can mutate them using an inmutable reference. However, neither `Cell<T>` nor +//! `RefCell<T>` are thread safe (they do not implement `Sync`), if you need to do Aliasing and +//! Mutation between multiple threads is possible to use `Mutex`, `RwLock` or `AtomicXXX`. //! //! Values of the `Cell<T>` and `RefCell<T>` types may be mutated through shared references (i.e. //! the common `&T` type), whereas most Rust types can only be mutated through unique (`&mut T`) |