From 9e3904337edc025f490dde7ad86693f54d3cb761 Mon Sep 17 00:00:00 2001 From: YAMAMOTO Takashi Date: Mon, 4 Sep 2023 19:01:09 +0900 Subject: [PATCH] Revert "Return error when exception was raised after main thread finishes" (#2524) This reverts commit 71d43f3ca18b96c983d0fa8ca45ea658d6f9ee4a. --- .../test/trap_after_main_thread_finishes.json | 3 --- product-mini/platforms/posix/main.c | 6 +----- product-mini/platforms/windows/main.c | 6 +----- 3 files changed, 2 insertions(+), 13 deletions(-) delete mode 100644 core/iwasm/libraries/lib-wasi-threads/test/trap_after_main_thread_finishes.json diff --git a/core/iwasm/libraries/lib-wasi-threads/test/trap_after_main_thread_finishes.json b/core/iwasm/libraries/lib-wasi-threads/test/trap_after_main_thread_finishes.json deleted file mode 100644 index 9dc1e30d2..000000000 --- a/core/iwasm/libraries/lib-wasi-threads/test/trap_after_main_thread_finishes.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "exit_code": 1 -} diff --git a/product-mini/platforms/posix/main.c b/product-mini/platforms/posix/main.c index 5d20fd293..6d4ada662 100644 --- a/product-mini/platforms/posix/main.c +++ b/product-mini/platforms/posix/main.c @@ -921,12 +921,8 @@ main(int argc, char *argv[]) #if WASM_ENABLE_LIBC_WASI != 0 if (ret == 0) { - /* wait for threads to finish and propagate wasi exit code. */ + /* propagate wasi exit code. */ ret = wasm_runtime_get_wasi_exit_code(wasm_module_inst); - if (wasm_runtime_get_exception(wasm_module_inst)) { - /* got an exception in spawned thread */ - ret = 1; - } } #endif diff --git a/product-mini/platforms/windows/main.c b/product-mini/platforms/windows/main.c index b7cf81433..8b1b1f371 100644 --- a/product-mini/platforms/windows/main.c +++ b/product-mini/platforms/windows/main.c @@ -554,12 +554,8 @@ main(int argc, char *argv[]) #if WASM_ENABLE_LIBC_WASI != 0 if (ret == 0) { - /* wait for threads to finish and propagate wasi exit code. */ + /* propagate wasi exit code. */ ret = wasm_runtime_get_wasi_exit_code(wasm_module_inst); - if (wasm_runtime_get_exception(wasm_module_inst)) { - /* got an exception in spawned thread */ - ret = 1; - } } #endif