MCPcopy Index your code
hub / github.com/SSheldon/rust-dispatch / wait_timeout

Method wait_timeout

src/sem.rs:36–46  ·  view source on GitHub ↗

Wait for (decrement) self until the specified timeout has elapsed.

(&self, timeout: Duration)

Source from the content-addressed store, hash-verified

34
35 /// Wait for (decrement) self until the specified timeout has elapsed.
36 pub fn wait_timeout(&self, timeout: Duration) -> Result<(), WaitTimeout> {
37 let when = time_after_delay(timeout);
38 let result = unsafe {
39 dispatch_semaphore_wait(self.ptr, when)
40 };
41 if result == 0 {
42 Ok(())
43 } else {
44 Err(WaitTimeout { duration: timeout })
45 }
46 }
47
48 /// Signal (increment) self.
49 ///

Callers 2

access_timeoutMethod · 0.45
test_afterFunction · 0.45

Calls 1

time_after_delayFunction · 0.85

Tested by 1

test_afterFunction · 0.36