Update RwLock deadlock example to not use shadowing

Tweak variable names in the deadlock example to remove any potential
confusion that the behavior is somehow shadowing-related.
This commit is contained in:
Trevor Gross 2024-03-26 21:38:28 -04:00
parent a1b499134a
commit 0cd57725f9

View File

@ -31,13 +31,14 @@ use crate::sys::sync as sys;
/// <details><summary>Potential deadlock example</summary>
///
/// ```text
/// // Thread 1 | // Thread 2
/// let _rg = lock.read(); |
/// | // will block
/// | let _wg = lock.write();
/// // may deadlock |
/// let _rg = lock.read(); |
/// // Thread 1 | // Thread 2
/// let _rg1 = lock.read(); |
/// | // will block
/// | let _wg = lock.write();
/// // may deadlock |
/// let _rg2 = lock.read(); |
/// ```
///
/// </details>
///
/// The type parameter `T` represents the data that this lock protects. It is