1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
/// Acquires an `async-lock::Mutex` by first attempting `try_lock()` and then
/// falling back on `lock().await`. This is proven to be faster than simply
/// calling `lock().await` [in our
/// benchmarks](https://github.com/khonsulabs/async-locking-benchmarks/).
/// Acquires a read handle to an `async-lock::RwLock` by first attempting
/// `try_read()` and then falling back on `read().await`. This is proven to be
/// faster than simply calling `read().await` [in our
/// benchmarks](https://github.com/khonsulabs/async-locking-benchmarks/).
/// Acquires a write handle to an `async-lock::RwLock` by first attempting
/// `try_write()` and then falling back on `write().await`. This is proven to be
/// faster than simply calling `write().await` [in our
/// benchmarks](https://github.com/khonsulabs/async-locking-benchmarks/).