diff options
| author | Botahamec <botahamec@outlook.com> | 2022-11-18 22:55:17 -0500 |
|---|---|---|
| committer | Botahamec <botahamec@outlook.com> | 2022-11-18 22:55:17 -0500 |
| commit | 838d37e84340259d8ce1313a6985e688c77fb770 (patch) | |
| tree | a0605ffc777dfb520fd463138da99d945f4b58ff /src | |
| parent | 50f7c15e00c5c55604e0cda82cba577588b25360 (diff) | |
Moved some docs
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 /// /// ``` |
