Clarified docs in std::sync::RwLock#153555
Conversation
|
rustbot has assigned @Mark-Simulacrum. Use Why was this reviewer chosen?The reviewer was selected based on:
|
|
Can we add a test that e.g. at least 2^32 read locks can be acquired and then document that? I've certainly written code (though not particularly cross-platform deployed code) that would benefit from a stronger guarantee here, and it seems like at least on tier 1 targets (for which we test in CI) we should be able to give a stronger guarantee than 'at least 2' :) |
I can do that for sure. Regarding the test, do you want me to add this in as a doctest within the |
|
I don't think it should be a doc test, seems too noisy for the docs. |
This addresses the issue with the
std::sync::RwLockdocs in #115338. It centers around the following lines:It's true that the
RwLockin 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