1
0
mirror of https://github.com/google/comprehensive-rust.git synced 2024-11-21 13:25:53 +02:00

Simplify language on mutex page (#2440)

The “iff” phrasing has confused people in the past.
This commit is contained in:
Martin Geisler 2024-10-18 03:04:10 -04:00 committed by GitHub
parent fb17791c26
commit 0f00434a0f
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -39,8 +39,8 @@ implementation.
protected data.
- You can get an `&mut T` from an `&Mutex<T>` by taking the lock. The
`MutexGuard` ensures that the `&mut T` doesn't outlive the lock being held.
- `Mutex<T>` implements both `Send` and `Sync` iff (if and only if) `T`
implements `Send`.
- `Mutex<T>` implements both `Send` and `Sync` if and only if `T` implements
`Send`.
- A read-write lock counterpart: `RwLock`.
- Why does `lock()` return a `Result`?
- If the thread that held the `Mutex` panicked, the `Mutex` becomes "poisoned"