Wait to access a resource protected by self. This decrements self and returns a guard that increments when dropped.
(&self)
| 58 | /// Wait to access a resource protected by self. |
| 59 | /// This decrements self and returns a guard that increments when dropped. |
| 60 | pub fn access(&self) -> SemaphoreGuard { |
| 61 | self.wait(); |
| 62 | SemaphoreGuard::new(self.clone()) |
| 63 | } |
| 64 | |
| 65 | /// Wait until the specified timeout to access a resource protected by self. |
| 66 | /// This decrements self and returns a guard that increments when dropped. |