MCPcopy Create free account
hub / github.com/cloud-hypervisor/cloud-hypervisor / wait_for_eventfd

Function wait_for_eventfd

performance-metrics/src/util.rs:351–361  ·  view source on GitHub ↗

Spin and wait until the given eventfd becomes readable.

(notifier: &EventFd)

Source from the content-addressed store, hash-verified

349
350/// Spin and wait until the given eventfd becomes readable.
351pub 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}

Callers 2

micro_bench_aio_drainFunction · 0.85
drain_async_completionsFunction · 0.85

Calls 2

kindMethod · 0.80
readMethod · 0.45

Tested by

no test coverage detected