summaryrefslogtreecommitdiff
path: root/desktop/source
diff options
context:
space:
mode:
authorStephan Bergmann <stephan.bergmann@allotropia.de>2024-10-09 19:00:21 +0200
committerStephan Bergmann <stephan.bergmann@allotropia.de>2024-10-10 14:39:24 +0200
commit33aa490cd6c18474f83ddd2b5f91ffc5c42a34d9 (patch)
treee18df98f7cd2058f58e68e326b3b280c8b8ad34b /desktop/source
parente9dcbf84f94b90ee8cd78628a0c9b5fb131d1085 (diff)
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 <stephan.bergmann@allotropia.de> Tested-by: Jenkins
Diffstat (limited to 'desktop/source')
-rw-r--r--desktop/source/app/appinit.cxx9
1 files changed, 9 insertions, 0 deletions
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 <emscripten/threading.h>
#include <emscripten/val.h>
#include <bindings_uno.hxx>
+#include <config_emscripten.h>
#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() {