MCPcopy Create free account
hub / github.com/SSheldon/rust-dispatch / test_semaphore

Function test_semaphore

src/sem.rs:120–127  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

118
119 #[test]
120 fn test_semaphore() {
121 let sem = Semaphore::new(0);
122
123 assert!(!sem.signal());
124 sem.wait();
125
126 assert!(sem.wait_timeout(Duration::from_millis(5)).is_err());
127 }
128
129 #[test]
130 fn test_semaphore_guard() {

Callers

nothing calls this directly

Calls 1

waitMethod · 0.45

Tested by

no test coverage detected