File tree 1 file changed +9
-0
lines changed
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> {
205
205
/// held. An RAII guard is returned to allow scoped unlock of the lock. When
206
206
/// the guard goes out of scope, the mutex will be unlocked.
207
207
///
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
+ ///
208
212
/// # Errors
209
213
///
210
214
/// If another user of this mutex panicked while holding the mutex, then
211
215
/// 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.
212
221
#[ stable( feature = "rust1" , since = "1.0.0" ) ]
213
222
pub fn lock ( & self ) -> LockResult < MutexGuard < T > > {
214
223
unsafe {
You can’t perform that action at this time.
0 commit comments