From 33aa490cd6c18474f83ddd2b5f91ffc5c42a34d9 Mon Sep 17 00:00:00 2001 From: Stephan Bergmann Date: Wed, 9 Oct 2024 19:00:21 +0200 Subject: Make --disable-emscripten-proxy-to-pthread configurable ...as is convenient for some experiments Change-Id: I74aedb38ecc0f7b5a0d913799f649dce77dc7bba Reviewed-on: https://gerrit.libreoffice.org/c/core/+/174753 Reviewed-by: Stephan Bergmann Tested-by: Jenkins --- desktop/source/app/appinit.cxx | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'desktop/source') diff --git a/desktop/source/app/appinit.cxx b/desktop/source/app/appinit.cxx index 16f023b0a414..6c7637f32f9e 100644 --- a/desktop/source/app/appinit.cxx +++ b/desktop/source/app/appinit.cxx @@ -54,6 +54,7 @@ #include #include #include +#include #endif using namespace ::com::sun::star::uno; @@ -94,12 +95,20 @@ EM_JS(void, setupMainChannel, (), { }); extern "C" void resolveUnoMain(pthread_t id) { +#if HAVE_EMSCRIPTEN_PROXY_TO_PTHREAD EM_ASM({ const sofficeMain = PThread.pthreads[$0]; const channel = new MessageChannel(); sofficeMain.postMessage({cmd:"LOWA-channel"}, [channel.port2]); Module.uno_main$resolve(channel.port1); }, id); +#else + EM_ASM({ + const channel = new MessageChannel(); + postMessage({cmd:"LOWA-channel"}, [channel.port2]); + Module.uno_main$resolve(channel.port1); + }, id); +#endif } void initUno() { -- cgit