diff options
Diffstat (limited to 'src')
| -rw-r--r-- | src/mutex.rs | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/src/mutex.rs b/src/mutex.rs index e09d47b..9231f65 100644 --- a/src/mutex.rs +++ b/src/mutex.rs @@ -73,6 +73,12 @@ unsafe impl RawMutex for RawSpin { /// returned from [`lock`] and [`try_lock`], which guarantees that the data is /// only ever accessed when the mutex is locked. /// +/// Locking the mutex on a thread that already locked it is impossible, due to +/// the requirement of the [`ThreadKey`]. Therefore, this will never deadlock. +/// When the [`MutexGuard`] is dropped, the [`ThreadKey`] can be reobtained by +/// calling [`ThreadKey::lock`]. You can also get it by calling +/// [`Mutex::unlock`]. +/// /// [`lock`]: `Mutex::lock` /// [`try_lock`]: `Mutex::try_lock` pub struct Mutex<R, T: ?Sized> { @@ -173,12 +179,6 @@ impl<R: RawMutex, T: ?Sized> Mutex<R, T> { /// `Mutex`. A [`MutexGuard`] is returned to allow a scoped unlock of this /// `Mutex`. When the guard is dropped, this `Mutex` will unlock. /// - /// Locking the mutex on a thread that already locked it is impossible, due - /// to the requirement of the [`ThreadKey`]. Therefore, this will never - /// deadlock. When the [`MutexGuard`] is dropped, the [`ThreadKey`] can be - /// reobtained by calling [`ThreadKey::lock`]. You can also get it - /// by calling [`Mutex::unlock`]. - /// /// # Examples /// /// ``` |
