mirror of
https://github.com/rust-lang/rust.git
synced 2026-04-27 18:57:42 +03:00
08343b5707
Clarified docs in std::sync::RwLock + added test to ensure that max reader count is respected This addresses the issue with the [`std::sync::RwLock` docs](https://doc.rust-lang.org/std/sync/struct.RwLock.html) in rust-lang/rust#115338. It centers around the following lines: > An `RwLock` will allow any number of readers to acquire the lock as long as a writer is not holding the lock. It's true that the `RwLock` in theory should allow any number of readers to acquire the lock when a writer is not holding it, but this may not be true in the implementation and could be os dependent. I decided to replace "any number of readers" to "multiple", so that it implies that more than 1 reader can acquire the lock, but you can't necessarily take away that this value is unbounded. @rustbot label +A-docs