Signal the Data Plane core to wake up.
(&self)
| 94 | impl EventFdNotifier { |
| 95 | /// Signal the Data Plane core to wake up. |
| 96 | pub fn notify(&self) { |
| 97 | let val: u64 = 1; |
| 98 | // SAFETY: writing 8 bytes to an eventfd is the documented API. |
| 99 | // This is atomic and thread-safe per the Linux man page. |
| 100 | unsafe { |
| 101 | libc::write( |
| 102 | self.fd, |
| 103 | &val as *const u64 as *const libc::c_void, |
| 104 | std::mem::size_of::<u64>(), |
| 105 | ); |
| 106 | } |
| 107 | } |
| 108 | } |
| 109 | |
| 110 | #[cfg(test)] |