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