diff options
| author | xizheyin <xizheyin@smail.nju.edu.cn> | 2025-03-31 15:11:23 +0800 |
|---|---|---|
| committer | xizheyin <xizheyin@smail.nju.edu.cn> | 2025-04-03 19:25:47 +0800 |
| commit | 0162f29436d7992ca5f3b642a282045afd922a26 (patch) | |
| tree | 381543f750528399f490b619236e729247ddf943 | |
| parent | ffb209710568fcb09d6971a509e6c64689da4982 (diff) | |
| download | rust-0162f29436d7992ca5f3b642a282045afd922a26.tar.gz rust-0162f29436d7992ca5f3b642a282045afd922a26.zip | |
std: clarify RwLock::get_mut more clearly
Signed-off-by: xizheyin <xizheyin@smail.nju.edu.cn>
| -rw-r--r-- | library/std/src/sync/poison/rwlock.rs | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/library/std/src/sync/poison/rwlock.rs b/library/std/src/sync/poison/rwlock.rs index f9d9321f5f2..a2abd4f692e 100644 --- a/library/std/src/sync/poison/rwlock.rs +++ b/library/std/src/sync/poison/rwlock.rs @@ -608,7 +608,9 @@ impl<T: ?Sized> RwLock<T> { /// Returns a mutable reference to the underlying data. /// /// Since this call borrows the `RwLock` mutably, no actual locking needs to - /// take place -- the mutable borrow statically guarantees no locks exist. + /// take place -- the mutable borrow statically guarantees no new locks can be acquired + /// while this reference exists. Note that this method does not clear any previously abandoned locks + /// (e.g., via [`forget()`] on a [`RwLockReadGuard`] or [`RwLockWriteGuard`]). /// /// # Errors /// |
