Support OPFS in WasmFS with standard Asyncify#26496
Support OPFS in WasmFS with standard Asyncify#26496brendandahl merged 1 commit intoemscripten-core:mainfrom
Conversation
| !emscripten_is_main_browser_thread() || | ||
| emscripten_has_asyncify() == 2 && | ||
| "Cannot safely create OPFS backend on main browser thread without JSPI"); | ||
| emscripten_has_asyncify() > 0 && |
There was a problem hiding this comment.
I think you can just drop the > 0 here
|
|
||
| _wasmfs_opfs_init_root_directory__deps: ['$wasmfsOPFSDirectoryHandles', '$wasmfsOPFSProxyFinish'], | ||
| _wasmfs_opfs_init_root_directory__async: {{{ !PTHREADS }}}, | ||
| _wasmfs_opfs_init_root_directory__async: 'auto', |
There was a problem hiding this comment.
Actually I think the issue here might be that prior to this change, the proxying for the pthread-builds was done manually in the C/C++ code.
If you land this change then you've added automatically proxying from backgroun threads, which I'm not sure you want... or at least I would expect you to be able to remove some manual proxying elsewhere?
There was a problem hiding this comment.
I thought the proxy stuff only happens if they're also marked with __proxy?
There was a problem hiding this comment.
Oh yes, sorry that is correct. That concern is not valid.
What about the fact that prior to this change the pthread builds did not use aysnc, and not they do? Is that OK?
There was a problem hiding this comment.
I skimmed through jsifier, __async only seems to have an affect if ASYNCIFY is set or if pthread is enabled AND __proxy: 'sync'. I also diffed the output of the test file using 'auto' and false and they were the same.
38ece4a to
2f590fc
Compare
Use the new 'auto' keyword to automatically wrap the opfs functions with `handleAsync`. Fixes Issue emscripten-core#23133
2f590fc to
e796c4e
Compare
Use the new 'auto' keyword to automatically wrap the opfs functions with
handleAsync.Fixes Issue #23133