MCPcopy Index your code
hub / github.com/RustPython/RustPython / set_interrupt_ex

Function set_interrupt_ex

crates/vm/src/signal.rs:123–135  ·  view source on GitHub ↗
(signum: i32, vm: &VirtualMachine)

Source from the content-addressed store, hash-verified

121#[allow(dead_code)]
122#[cfg(all(not(target_arch = "wasm32"), feature = "host_env"))]
123pub fn set_interrupt_ex(signum: i32, vm: &VirtualMachine) -> PyResult<()> {
124 use crate::stdlib::_signal::_signal::{SIG_DFL, SIG_IGN, run_signal};
125 assert_in_range(signum, vm)?;
126
127 match signum as usize {
128 SIG_DFL | SIG_IGN => Ok(()),
129 _ => {
130 // interrupt the main thread with given signal number
131 run_signal(signum);
132 Ok(())
133 }
134 }
135}
136
137pub type UserSignal = Box<dyn FnOnce(&VirtualMachine) -> PyResult<()> + Send>;
138

Callers 1

interrupt_mainFunction · 0.85

Calls 2

assert_in_rangeFunction · 0.85
run_signalFunction · 0.85

Tested by

no test coverage detected