File tree Expand file tree Collapse file tree 1 file changed +5
-0
lines changed
system/include/emscripten Expand file tree Collapse file tree 1 file changed +5
-0
lines changed Original file line number Diff line number Diff line change @@ -254,6 +254,11 @@ const char __em_asm_sig_builder<__em_asm_type_tuple<Args...> >::buffer[] = { __e
254254// functions.
255255#define MAIN_THREAD_EM_ASM (code, ...) ((void )emscripten_asm_const_int_sync_on_main_thread(CODE_EXPR(#code) _EM_ASM_PREP_ARGS(__VA_ARGS__)))
256256
257+ // Runs the given Javascript code on the main browser thread.
258+ // It must be called from a non-main thread.
259+ // The code must return a promise, and this function will wait for the promise
260+ // to resolve or reject, essentially blocking the calling thread until then.
261+ // In either case the function will return an integer, which is the result of the promise.
257262#define MAIN_THREAD_EM_ASM_PROMISE_AWAIT (code, ...) emscripten_asm_const_int_await_promise_on_main_thread(CODE_EXPR(#code) _EM_ASM_PREP_ARGS(__VA_ARGS__))
258263
259264// Runs the given JavaScript code synchronously on the main browser thread, and
You can’t perform that action at this time.
0 commit comments