Sends a signal to the underlying thread. Please call [`Self::wait_until_signal_acknowledged`] afterward to block until the vCPU thread has acknowledged the signal. If the thread is in KVM_RUN (or MSHV_RUN_VP or equivalent), this kicks the thread out of kernel space. If the thread is in user-space, the thread will just handle the event eventually. If the thread is in user-space but about to enter
(&self)
| 790 | /// handler will make sure that the next kernel entry of the given |
| 791 | /// vCPU thread immediately exits to handle the event in user-space. |
| 792 | fn signal_thread(&self) { |
| 793 | if let Some(handle) = self.handle.as_ref() { |
| 794 | // SAFETY: FFI call with correct arguments |
| 795 | unsafe { |
| 796 | libc::pthread_kill(handle.as_pthread_t() as _, SIGRTMIN()); |
| 797 | } |
| 798 | } |
| 799 | } |
| 800 | |
| 801 | /// Blocks until the vCPU thread has acknowledged the signal. It retries to send |
| 802 | /// the signal every 10ms. Times out after 1000ms. |
no outgoing calls
no test coverage detected