Reland "[skwasm] Dynamic Threading" (#166454)

This is a reland of https://github.com/flutter/flutter/pull/164748,
which was reverted here: https://github.com/flutter/flutter/pull/165350

It was reverted due to some issues in the flutter packages roller:
https://github.com/flutter/flutter/issues/165347

The unit test in flutter/packages was modified to be more deterministic
and less affected by minor timing differences:
https://github.com/flutter/packages/pull/8920

So this is basically being relanded without any significant changes,
since the downstream tests have been fixed.
This commit is contained in:
Jackson Gardner
2025-04-02 14:27:09 -07:00
committed by GitHub
parent f2e0a2afb3
commit 34ea67bdbf
16 changed files with 208 additions and 313 deletions

View File

@@ -277,9 +277,9 @@ config("compiler") {
}
if (is_wasm) {
if (wasm_use_pthreads) {
cflags += [ "-pthread" ]
ldflags += [ "-pthread" ]
if (wasm_use_workers) {
cflags += [ "-sWASM_WORKERS=1" ]
ldflags += [ "-sWASM_WORKERS=1" ]
} if (wasm_shared_memory) {
cflags += [ "-sSHARED_MEMORY=1" ]
ldflags += [ "-sSHARED_MEMORY=1" ]
@@ -396,12 +396,12 @@ config("compiler") {
# to say that it does. Define them here instead.
defines += [ "HAVE_SYS_UIO_H" ]
# When Android requires new flags consider also editing the flags in
# the following locations.
# When Android requires new flags consider also editing the flags in
# the following locations.
# Framework plugin_ffi template: packages/flutter_tools/templates/plugin_ffi/src.tmpl/CMakeLists.txt.tmpl
# Example PR: https://github.com/flutter/flutter/pull/155508
# Dart Lang JNI package: pkgs/jni/src/CMakeLists.txt
# Example PR: https://github.com/dart-lang/native/pull/1615
# Dart Lang JNI package: pkgs/jni/src/CMakeLists.txt
# Example PR: https://github.com/dart-lang/native/pull/1615
ldflags += [
"-Wl,--no-undefined",
"-Wl,--exclude-libs,ALL",

View File

@@ -11,7 +11,7 @@ declare_args() {
# The location of an activated embedded emsdk.
emsdk_dir = rebase_path("//flutter/prebuilts/emsdk")
wasm_use_pthreads = false
wasm_use_workers = false
wasm_shared_memory = false
wasm_use_dwarf = false
}