Wait until the specified timeout to access a resource protected by self. This decrements self and returns a guard that increments when dropped.
(&self, timeout: Duration)
| 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. |
| 67 | pub fn access_timeout(&self, timeout: Duration) |
| 68 | -> Result<SemaphoreGuard, WaitTimeout> { |
| 69 | self.wait_timeout(timeout)?; |
| 70 | Ok(SemaphoreGuard::new(self.clone())) |
| 71 | } |
| 72 | } |
| 73 | |
| 74 | unsafe impl Sync for Semaphore {} |
nothing calls this directly
no test coverage detected