1
0
mirror of https://github.com/google/comprehensive-rust.git synced 2025-06-15 22:00:26 +02:00

Improve interior mutability slide (#1683)

Mutex is probably more broadly understood by people coming from other
languages.

Fixes #1512.
This commit is contained in:
Dustin J. Mitchell
2024-01-17 08:53:05 -05:00
committed by GitHub
parent d731da4a5e
commit 73068d2af2
2 changed files with 34 additions and 24 deletions

View File

@ -1,7 +1,8 @@
# `Mutex`
[`Mutex<T>`][1] ensures mutual exclusion _and_ allows mutable access to `T`
behind a read-only interface:
behind a read-only interface (another form of
[interior mutability](../../borrowing/interior-mutability)):
```rust,editable
use std::sync::Mutex;