Skip to main content

run_on_this_thread

Function run_on_this_thread 

Source
pub fn run_on_this_thread(
    program: &Program,
    options: &Options,
    print: &mut (dyn FnMut(&str) + Send),
) -> Result<Outcome, RuntimeError>
Expand description

Run a program on the calling thread, as run does on a thread of its own. The calling thread’s stack must be large enough for the program’s calls (Limits::stack_size doesn’t apply), and a panic isn’t caught. With one thread allowed (Limits::max_threads), sampling starts no thread either, so this works where threads aren’t available, such as in WebAssembly.