Skip to content
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

Append em-pthread id to the web worker name. #22644

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

kolAflash
Copy link

Simplifies picking a web worker when using browser debug tools.

@kolAflash
Copy link
Author

Currently all web workers created for threads are called "em-pthread". So when using browser debug tools, you have to try out one web worker after another until you find the one you'd like to debug.

@@ -405,7 +405,7 @@ var LibraryPThread = {
#if ENVIRONMENT_MAY_BE_WEB || ENVIRONMENT_MAY_BE_WORKER
// This is the way that we signal to the Web Worker that it is hosting
// a pthread.
'name': 'em-pthread',
'name': 'em-pthread_' + PThread.nextWorkerID,
Copy link
Collaborator

Choose a reason for hiding this comment

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

Can you use a hyphen here?

Simplifies picking a web worker when using browser debug tools.
@sbc100
Copy link
Collaborator

sbc100 commented Sep 30, 2024

It looks like closure does't like this:

building:ERROR: /tmp/emscripten_temp_qawuf4_3/test.jso4.js:356:29: WARNING - [JSC_INEXISTENT_PROPERTY] Property nextWorkerID never defined on PThread
  356| "name":"em-pthread-"+PThread.nextWorkerID};var pthreadMainJs=_scriptName;// We can't use makeModuleReceiveWithVar here since we want to also

@sbc100
Copy link
Collaborator

sbc100 commented Sep 30, 2024

Ah yes, nextWorkerID is debug-only feature.

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