mirror of
https://github.com/google/comprehensive-rust.git
synced 2025-01-05 16:10:31 +02:00
Add Mutex information to Rc slide (#1001)
Add mutex information to Rc slide
This commit is contained in:
parent
0411d0c8e5
commit
2f86a259b6
@ -17,14 +17,15 @@ fn main() {
|
||||
|
||||
* If you need to mutate the data inside an `Rc`, you will need to wrap the data in
|
||||
a type such as [`Cell` or `RefCell`][2].
|
||||
* See [`Arc`][3] if you are in a multi-threaded context.
|
||||
* You can *downgrade* a shared pointer into a [`Weak`][4] pointer to create cycles
|
||||
* See [`Arc`][3] and [`Mutex`][4] if you are in a multi-threaded context.
|
||||
* You can *downgrade* a shared pointer into a [`Weak`][5] pointer to create cycles
|
||||
that will get dropped.
|
||||
|
||||
[1]: https://doc.rust-lang.org/std/rc/struct.Rc.html
|
||||
[2]: https://doc.rust-lang.org/std/cell/index.html
|
||||
[3]: ../concurrency/shared_state/arc.md
|
||||
[4]: https://doc.rust-lang.org/std/rc/struct.Weak.html
|
||||
[4]: https://doc.rust-lang.org/std/sync/struct.Mutex.html
|
||||
[5]: https://doc.rust-lang.org/std/rc/struct.Weak.html
|
||||
|
||||
<details>
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user