File tree Expand file tree Collapse file tree 1 file changed +5
-1
lines changed Expand file tree Collapse file tree 1 file changed +5
-1
lines changed Original file line number Diff line number Diff line change @@ -582,7 +582,9 @@ impl<T: ?Sized> Mutex<T> {
582582 /// Returns a mutable reference to the underlying data.
583583 ///
584584 /// Since this call borrows the `Mutex` mutably, no actual locking needs to
585- /// take place -- the mutable borrow statically guarantees no locks exist.
585+ /// take place -- the mutable borrow statically guarantees no new locks can be acquired
586+ /// while this reference exists. Note that this method does not clear any previous abandoned locks
587+ /// (e.g., via [`forget()`] on a [`MutexGuard`]).
586588 ///
587589 /// # Errors
588590 ///
@@ -599,6 +601,8 @@ impl<T: ?Sized> Mutex<T> {
599601 /// *mutex.get_mut().unwrap() = 10;
600602 /// assert_eq!(*mutex.lock().unwrap(), 10);
601603 /// ```
604+ ///
605+ /// [`forget()`]: mem::forget
602606 #[ stable( feature = "mutex_get_mut" , since = "1.6.0" ) ]
603607 pub fn get_mut ( & mut self ) -> LockResult < & mut T > {
604608 let data = self . data . get_mut ( ) ;
You can’t perform that action at this time.
0 commit comments