-
Notifications
You must be signed in to change notification settings - Fork 3.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Strange behaviour when detecting ENVIRONMENT_IS_PTHREAD #22541
Comments
If you are seeing the I suppose the question is why isn't Can you share the full set of link flags you are using? |
Yes, you are right. I read the condition the other way around. Module['canvas'] is correctly set, the problem is on the second condition About link flags:
|
I see, can the canvas only be transfer to one thread? I guess that why It looks like you can override emscripten/system/lib/libc/crt1_proxy_main.c Lines 45 to 48 in 8800faa
|
Hmmm, the situation is similar but not the same.
In this case, the canvas is initially transferred to the proxied thread (AFAIK, due to the special 4294967295 value in the code), and it successfully works on thread 3's creation requesting a canvas. But in this case,
It is printing the above errors. It has something to do with the fact that the Thread 3 canvas transferring process it detects that the canvas was already transferred, which is correct, but to the main thread, not thread 2 or any other thread. |
I am porting a multithreaded library and when creating (and transferring the canvas to) a thread I get the following error:
My code is creating a new thread from another thread already created. If I use the main thread, everything works as expected.
I first thought that it was not possible to create a thread from another thread but there is this code:
Which made me discard that idea, reviewing the .js code I see this:
For some reason, the thread I'm creating the new thread on is evaluating to True in
ENVIRONMENT_IS_PTHREAD
Any idea what is going on? My understanding is that it should evaluate to False and then recall this proxied from the main thread.
Important topic, this only happens with -sPROXY_TO_PTHREAD set
The text was updated successfully, but these errors were encountered: