emscripten-core/emscripten
Auf GitHub ansehenName pthread workers for easier debugging
Open
#12.216 geöffnet am 15. Sept. 2020
good first bughelp wanted
Repository-Metriken
- Stars
- (27.361 Stars)
- PR-Merge-Metriken
- (Durchschn. Merge 19T 10h) (147 gemergte PRs in 30 T)
Beschreibung
This is a feature suggestion.
Workers accept an optional name which can be used for debugging, e.g. in DevTools we show the name in the Sources panel.

The name is also available to the worker via globalThis.name.
My suggestion is that in src/library_pthread.js, in allocateUnusedWorker when we call new Worker(), we give a useful name like pthread #1 etc.
Right now threads just show up with the file name (which also means all the threads have the same name).