Fixess
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
#include "global.h"
|
||||
|
||||
static pthread_t selfTID{pthread_self()};
|
||||
void throwJS(const char* msg, bool err) {
|
||||
EM_ASM({
|
||||
@@ -13,16 +14,13 @@ void fireEv(const char *type, const char *content, int index) {
|
||||
static ProxyingQueue pq{};
|
||||
auto proxy{[index, type, content](){
|
||||
EM_ASM({
|
||||
console.log("Event type ", UTF8ToString($1), ", content " , UTF8ToString($2), ", sending to ", objs[$0]);
|
||||
objs[$0].dispatchEvent(new CustomEvent(UTF8ToString($1), {"detail" : UTF8ToString($2)}));
|
||||
},index, type, content);
|
||||
}};
|
||||
if(selfTID == pthread_self()) {
|
||||
emscripten_console_log("Self dispatch");
|
||||
proxy();
|
||||
return;
|
||||
}
|
||||
emscripten_console_log("Thread dispatch");
|
||||
pq.proxySync(selfTID, proxy);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user