Skip to content

Conversation

juj
Copy link
Collaborator

@juj juj commented Sep 8, 2025

@@ -0,0 +1,3 @@
if (!ENVIRONMENT_IS_PTHREAD) {
Module.print = (text) => { console.log(text); }
}
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why is this file needed? Shouldn't we be testing the default behaviour of emscripten_out

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh I see your are testing both.

What happens if you override Module.print on the pthreads too? i.e. is the if condition import here? I would hope not, since calls out should be proxied back to the main threads's print handler regardless.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is the if condition import here?

Yes, it is important.

I would hope not, since calls out should be proxied back to the main threads's print handler regardless.

No, that is not correct. If pthread overrides a print handler, then it is not proxied to the main thread.

if (!Module[handler] || Module[handler].proxy) {

@juj
Copy link
Collaborator Author

juj commented Sep 16, 2025

I'll close this since we were not able to remove the broken behavior.

@juj juj closed this Sep 16, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants