File tree Expand file tree Collapse file tree 1 file changed +9
-0
lines changed Expand file tree Collapse file tree 1 file changed +9
-0
lines changed Original file line number Diff line number Diff line change @@ -205,10 +205,19 @@ impl<T: ?Sized> Mutex<T> {
205205 /// held. An RAII guard is returned to allow scoped unlock of the lock. When
206206 /// the guard goes out of scope, the mutex will be unlocked.
207207 ///
208+ /// The exact behavior on locking a mutex in the thread which already holds
209+ /// the lock is left unspecified, however, this function will not return on
210+ /// the second call, it might e.g. panic or deadlock.
211+ ///
208212 /// # Errors
209213 ///
210214 /// If another user of this mutex panicked while holding the mutex, then
211215 /// this call will return an error once the mutex is acquired.
216+ ///
217+ /// # Panics
218+ ///
219+ /// This function might panic when called if the lock is already held by
220+ /// the current thread.
212221 #[ stable( feature = "rust1" , since = "1.0.0" ) ]
213222 pub fn lock ( & self ) -> LockResult < MutexGuard < T > > {
214223 unsafe {
You can’t perform that action at this time.
0 commit comments