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

Method signal_thread

vmm/src/cpu.rs:792–799  ·  view source on GitHub ↗

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)

Source from the content-addressed store, hash-verified

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.

Callers 3

signal_vcpusMethod · 0.80
remove_vcpuMethod · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected