Description
Location
https://doc.rust-lang.org/std/sync/struct.RwLock.html#method.try_write
Summary
The docs for RwLock::try_write
say:
This function will return the WouldBlock error if the
RwLock
could not be acquired because it was already locked exclusively.
I believe it should say "because it already has a shared or exclusive lock", based on how RwLock
works (and based on my reading of the code). The sibling methods (read
, write
) clarify this detail correctly, and try_write
's docs appear to be copied from try_read
(where this description is correct), so I think this is just a small oversight from copying the description.
(For context, I was initially checking whether RwLock
had some way to indicate that the lock was writer-locked, and this description confused me at first.)