File tree 1 file changed +13
-1
lines changed
1 file changed +13
-1
lines changed Original file line number Diff line number Diff line change @@ -23,7 +23,19 @@ use crate::sys_common::rwlock as sys;
23
23
/// system's implementation, and this type does not guarantee that any
24
24
/// particular policy will be used. In particular, a writer which is waiting to
25
25
/// acquire the lock in `write` might or might not block concurrent calls to
26
- /// `read`.
26
+ /// `read`, e.g.:
27
+ ///
28
+ /// <details><summary>Potential deadlock example</summary>
29
+ ///
30
+ /// ```text
31
+ /// // Thread 1 | // Thread 2
32
+ /// let _rg = lock.read(); |
33
+ /// | // will block
34
+ /// | let _wg = lock.write();
35
+ /// // may deadlock |
36
+ /// let _rg = lock.read(); |
37
+ /// ```
38
+ /// </details>
27
39
///
28
40
/// The type parameter `T` represents the data that this lock protects. It is
29
41
/// required that `T` satisfies [`Send`] to be shared across threads and
You can’t perform that action at this time.
0 commit comments