Skip to content

Commit f88718d

Browse files
authored
JIT: don't join worker threads twice (#4252)
in case of WASM_ENABLE_LAZY_JIT==0, compile_jit_functions should have already joined these threads. joining them again here is an undefined behavior.
1 parent ca5a2fa commit f88718d

File tree

2 files changed

+4
-0
lines changed

2 files changed

+4
-0
lines changed

core/iwasm/interpreter/wasm_loader.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5711,6 +5711,7 @@ orcjit_thread_callback(void *arg)
57115711
static void
57125712
orcjit_stop_compile_threads(WASMModule *module)
57135713
{
5714+
#if WASM_ENABLE_LAZY_JIT != 0
57145715
uint32 i, thread_num = (uint32)(sizeof(module->orcjit_thread_args)
57155716
/ sizeof(OrcJitThreadArg));
57165717

@@ -5719,6 +5720,7 @@ orcjit_stop_compile_threads(WASMModule *module)
57195720
if (module->orcjit_threads[i])
57205721
os_thread_join(module->orcjit_threads[i], NULL);
57215722
}
5723+
#endif
57225724
}
57235725

57245726
static bool

core/iwasm/interpreter/wasm_mini_loader.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2493,6 +2493,7 @@ orcjit_thread_callback(void *arg)
24932493
static void
24942494
orcjit_stop_compile_threads(WASMModule *module)
24952495
{
2496+
#if WASM_ENABLE_LAZY_JIT != 0
24962497
uint32 i, thread_num = (uint32)(sizeof(module->orcjit_thread_args)
24972498
/ sizeof(OrcJitThreadArg));
24982499

@@ -2501,6 +2502,7 @@ orcjit_stop_compile_threads(WASMModule *module)
25012502
if (module->orcjit_threads[i])
25022503
os_thread_join(module->orcjit_threads[i], NULL);
25032504
}
2505+
#endif
25042506
}
25052507

25062508
static bool

0 commit comments

Comments
 (0)