Skip to content

Commit

Permalink
rust runner: stop eating errors in threads
Browse files Browse the repository at this point in the history
  • Loading branch information
tombl committed Mar 26, 2024
1 parent d851a12 commit b853fce
Showing 1 changed file with 10 additions and 10 deletions.
20 changes: 10 additions & 10 deletions tools/wasm-runner/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -170,16 +170,16 @@ fn add_imports(linker: &mut Linker<State>, is_debug: bool) -> anyhow::Result<()>

std::thread::Builder::new()
.name(String::from_utf8_lossy(&name).to_string())
.spawn(move || -> anyhow::Result<()> {
.spawn(move || {
let mut store = Store::new(&engine, data);

instance_pre
.instantiate(&mut store)?
.instantiate(&mut store)
.unwrap()
.get_typed_func::<u32, ()>(&mut store, "task")
.expect("the function exists")
.call(&mut store, task)?;

Ok(())
.call(&mut store, task)
.unwrap();
})?;

Ok(())
Expand All @@ -198,16 +198,16 @@ fn add_imports(linker: &mut Linker<State>, is_debug: bool) -> anyhow::Result<()>

std::thread::Builder::new()
.name(format!("entry{cpu}"))
.spawn(move || -> anyhow::Result<()> {
.spawn(move || {
let mut store = Store::new(&engine, data);

instance_pre
.instantiate(&mut store)?
.instantiate(&mut store)
.unwrap()
.get_typed_func::<(u32, u32), ()>(&mut store, "secondary")
.expect("the function exists")
.call(&mut store, (cpu, idle))?;

Ok(())
.call(&mut store, (cpu, idle))
.unwrap();
})?;

Ok(())
Expand Down

0 comments on commit b853fce

Please sign in to comment.