Skip to content

Commit 0162f29

Browse files
committed
std: clarify RwLock::get_mut more clearly
Signed-off-by: xizheyin <[email protected]>
1 parent ffb2097 commit 0162f29

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

Diff for: library/std/src/sync/poison/rwlock.rs

+3-1
Original file line numberDiff line numberDiff line change
@@ -608,7 +608,9 @@ impl<T: ?Sized> RwLock<T> {
608608
/// Returns a mutable reference to the underlying data.
609609
///
610610
/// Since this call borrows the `RwLock` mutably, no actual locking needs to
611-
/// take place -- the mutable borrow statically guarantees no locks exist.
611+
/// take place -- the mutable borrow statically guarantees no new locks can be acquired
612+
/// while this reference exists. Note that this method does not clear any previously abandoned locks
613+
/// (e.g., via [`forget()`] on a [`RwLockReadGuard`] or [`RwLockWriteGuard`]).
612614
///
613615
/// # Errors
614616
///

0 commit comments

Comments
 (0)