Returning back to WASM multi-threading after COOP/COEP put a spanner in the 
works when I last tried it. Unfortunately, the Emscripten toolchain has 
much changed since I last managed to compile a multi-threaded build. 

Specifically, I am running into what looks like a trivial problem. This 
code won't compile:

#include <emscripten/threading.h>
#include <stdio.h>

static void a(int arg) { 
    printf("Hello %i\n", arg);
 }

int main(int argc, char **argv) {
   em_queued_call q = {
       .functionEnum = EM_FUNC_SIG_VI,
       .functionPtr = a
    };
    q.args[0].i = 42;
    emscripten_sync_run_in_main_thread(&q);
}

Specifically, the struct em_queued_call is only partially defined (as per 
emscripten/threading.h 
<https://github.com/emscripten-core/emscripten/blob/main/system/include/emscripten/threading.h#L49>),
 
where the full definition (in threading_internal.h 
<https://github.com/emscripten-core/emscripten/blob/main/system/lib/pthread/threading_internal.h#L23>)
 
is not included.

I am compiling like so:

emcc -pthread test.c

Doesn't get any simpler. I remember this worked with an old Emscripten 
version 1.XX, but no more. 

Any ideas?
Soeren

-- 
You received this message because you are subscribed to the Google Groups 
"emscripten-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to emscripten-discuss+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/emscripten-discuss/b6360d3c-0597-458a-a222-883d29c217fcn%40googlegroups.com.

Reply via email to