Spin and wait until the given eventfd becomes readable.
(notifier: &EventFd)
| 349 | |
| 350 | /// Spin and wait until the given eventfd becomes readable. |
| 351 | pub fn wait_for_eventfd(notifier: &EventFd) { |
| 352 | loop { |
| 353 | match notifier.read() { |
| 354 | Ok(_) => return, |
| 355 | Err(e) if e.kind() == ErrorKind::WouldBlock => { |
| 356 | thread::sleep(Duration::from_micros(50)); |
| 357 | } |
| 358 | Err(e) => panic!("eventfd read failed: {e}"), |
| 359 | } |
| 360 | } |
| 361 | } |
no test coverage detected