Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions system/lib/pthread/emscripten_thread_state.S
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ is_runtime_thread:
.globaltype supports_wait, i32
supports_wait:

#if WASM_WORKERS_ONLY
#if __EMSCRIPTEN_WASM_WORKERS__
.globaltype done_init, i32
done_init:
#endif
Expand All @@ -38,7 +38,7 @@ __set_thread_state:
global.set supports_wait
end_function

#if WASM_WORKERS_ONLY
#if __EMSCRIPTEN_WASM_WORKERS__
// With Wasm Workers we do lazy initializtion of the thread
// state so that only workers that call these APIs actually
// initializes their state.
Expand All @@ -59,7 +59,7 @@ lazy_init_thread_state:
.globl __get_tp
__get_tp:
.functype __get_tp () -> (PTR)
#if WASM_WORKERS_ONLY
#if __EMSCRIPTEN_WASM_WORKERS__
call lazy_init_thread_state
#endif
global.get thread_ptr
Expand All @@ -69,7 +69,7 @@ __get_tp:
.globl emscripten_is_main_runtime_thread
emscripten_is_main_runtime_thread:
.functype emscripten_is_main_runtime_thread () -> (i32)
#if WASM_WORKERS_ONLY
#if __EMSCRIPTEN_WASM_WORKERS__
call lazy_init_thread_state
#endif
global.get is_runtime_thread
Expand All @@ -79,7 +79,7 @@ emscripten_is_main_runtime_thread:
.globl emscripten_is_main_browser_thread
emscripten_is_main_browser_thread:
.functype emscripten_is_main_browser_thread () -> (i32)
#if WASM_WORKERS_ONLY
#if __EMSCRIPTEN_WASM_WORKERS__
call lazy_init_thread_state
#endif
global.get is_main_thread
Expand All @@ -89,7 +89,7 @@ emscripten_is_main_browser_thread:
.globl _emscripten_thread_supports_atomics_wait
_emscripten_thread_supports_atomics_wait:
.functype _emscripten_thread_supports_atomics_wait () -> (i32)
#if WASM_WORKERS_ONLY
#if __EMSCRIPTEN_WASM_WORKERS__
call lazy_init_thread_state
#endif
global.get supports_wait
Expand Down
4 changes: 2 additions & 2 deletions tools/system_libs.py
Original file line number Diff line number Diff line change
Expand Up @@ -714,9 +714,9 @@ def __init__(self, **kwargs):
def get_cflags(self):
cflags = super().get_cflags()
if self.is_mt:
cflags += ['-pthread', '-sWASM_WORKERS']
cflags += ['-pthread']
if self.is_ww:
cflags += ['-sWASM_WORKERS', '-DWASM_WORKERS_ONLY']
cflags += ['-sWASM_WORKERS']
return cflags

def get_base_name(self):
Expand Down
Loading