Skip to content

Commit

Permalink
toywasm_repl_invoke: wait for other threads in case of non-trap return
Browse files Browse the repository at this point in the history
Note: for some reasons, the current logic in wasi-libc crt returns
without wasi_proc_exit when the exit code is 0.  maybe just to save
a host call?

cf. WebAssembly/wasi-libc#367
  • Loading branch information
yamt committed Dec 20, 2022
1 parent a1dfc3c commit c568595
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions cli/repl.c
Original file line number Diff line number Diff line change
Expand Up @@ -819,6 +819,12 @@ toywasm_repl_invoke(struct repl_state *state, const char *modname,
goto fail;
}
print_trap(ctx, trap);
} else {
#if defined(TOYWASM_ENABLE_WASI_THREADS)
if (state->wasi_threads != NULL) {
wasi_threads_instance_join(state->wasi_threads);
}
#endif
}
exec_context_clear(ctx);
if (ret != 0) {
Expand Down

0 comments on commit c568595

Please sign in to comment.